LLBLGen 4.1 support for DevArt PostgreSQL driver

Posts   
 
    
khorvat avatar
khorvat
User
Posts: 65
Joined: 17-Feb-2011
# Posted on: 29-Apr-2015 10:35:25   

Hi,

can you let me know if LLBLGen 4.1 supports DevArt dotConnect for PostgreSQL driver and if so how to configure the designer to use the ADO.NET driver ?

Do I have to add configuration to DbProviderFactories and add the factory dlls to Drivers folder or ?

Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 29-Apr-2015 14:49:13   

we only support npgsql, no other provider for postgresql. In theory you could make it work by changing the factory name in the driver's sourcecode (which is available in the sourcecode archive on the website) but it is likely they use other type mappings for some types.

Is there a reason why you would want to use that provider?

Frans Bouma | Lead developer LLBLGen Pro
khorvat avatar
khorvat
User
Posts: 65
Joined: 17-Feb-2011
# Posted on: 29-Apr-2015 15:19:09   

Well, I'm using it for the rest of the solution, which uses EF6, but I would like to use LLBLGen for new modules. I find LLBLGen better fit for my new modules and I can extend and inject SQL easier than in EF.

Do you know if npgsql supports async/await and do you support pg 9.4 with JSONB as this is a must for me ?

Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 30-Apr-2015 10:04:40   

khorvat wrote:

Well, I'm using it for the rest of the solution, which uses EF6, but I would like to use LLBLGen for new modules. I find LLBLGen better fit for my new modules and I can extend and inject SQL easier than in EF.

Do you know if npgsql supports async/await and do you support pg 9.4 with JSONB as this is a must for me ?

Thanks

Sorry, no. Async/await is currently being developed in the v3.0 branch on github. https://github.com/npgsql. JSON/JSONB are supported types in npgsql but we haven't added them to the designer/runtime yet as we have to see how to use them properly. It might be they are reported as string types, we haven't looked into that.

Frans Bouma | Lead developer LLBLGen Pro
khorvat avatar
khorvat
User
Posts: 65
Joined: 17-Feb-2011
# Posted on: 30-Apr-2015 11:47:25   

Hi, thanks for the update I hope that v3 will be out soon, and as for the JSON/JSONB right now I'm getting string data type when generated by EF 6.1.x using DevArt dotConnect for PG.

I'll try to generate my schema using LLBLGen and get back to you on that.

Thanks

khorvat avatar
khorvat
User
Posts: 65
Joined: 17-Feb-2011
# Posted on: 14-May-2015 11:27:37   

Hi,

we have tested the LLBLGen 4.2 and PostgreSQL with JSON and JSONB support. Fields are generated as string which is acceptable and fetching the records works fine. The problem occures when we try to save the entity with JSONB field type:

SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException: An exception was caught during the execution of an action query: ERROR: 42804: column "Json" is of type jsonb but expression is of type character varying. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception. ---> Npgsql.NpgsqlException: ERROR: 42804: column "Json" is of type jsonb but expression is of type character varying at Npgsql.NpgsqlState.<ProcessBackendResponses>d__1.MoveNext() at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject(Boolean cleanup) at Npgsql.ForwardsOnlyDataReader.GetNextRowDescription() at Npgsql.ForwardsOnlyDataReader.NextResultInternal() at Npgsql.ForwardsOnlyDataReader..ctor(IEnumerable1 dataEnumeration, CommandBehavior behavior, NpgsqlCommand command, NotificationThreadBlock threadBlock, Boolean preparedStatement, NpgsqlRowDescription rowDescription) at Npgsql.NpgsqlCommand.GetReader(CommandBehavior cb) at Npgsql.NpgsqlCommand.ExecuteNonQuery() at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute() --- End of inner exception stack trace --- at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute() at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.ExecuteActionQuery(IActionQuery queryToExecute) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.PersistQueue(List1 queueToPersist, Boolean insertActions) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.SaveEntity(IEntity2 entityToSave, Boolean refetchAfterSave, IPredicateExpression updateRestriction, Boolean recurse) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.<>n__FabricatedMethodf5(IEntity2 , Boolean , IPredicateExpression , Boolean ) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.<>c__DisplayClassf3.<SaveEntity>b__f2() at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.ExecuteWithActiveRecoveryStrategy[T](Func`1 toExecute) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.SaveEntity(IEntity2 entityToSave, Boolean refetchAfterSave, IPredicateExpression updateRestriction, Boolean recurse) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterCore.SaveEntity(IEntity2 entityToSave)

We have tested the Npgsql driver and he has a support for JSON/JSONB so updating the record with ADO.NET using the driver works properly. In order for this to work properly we had to set the parameter type to NpgsqlTypes.NpgsqlDbType.Jsonb.

Can you let us know when can we expect this bug to be fixed ? Any ETA will be appreciated.

Regards

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 15-May-2015 10:02:21   

We won't add stuff to v4.1, so the type support will be added to v4.2. We also have to check whether it's in the latest RTM release of npgsql, but I think it is. (i.e.: if it's in the 3.0 alpha, we'll wait).

The way it works is simple: the type name in the generated persistenceinfo class should be the name of the NpgsqlDbType enum value, so Jsonb. That name is used at runtime to find back the enum value in a lookup table to obtain the proper value which is then set in the parameter. So what has to be updated is the driver type table.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 15-May-2015 11:05:07   

Json / Jsonb are added to v4.2 in the next build (released later today). The changes are minor, but we won't backport them to v4.1 as it also requires additional tests for v4.1 and in general we don't backport features. The changes are in the PostgresqlDbdriver.cs file and in the constantenums to add the enum value. You can backport the changes yourself to the v4.1 driver source using windiff on the v4.2 sourcecode we'll be posting later today.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 15-May-2015 17:50:55   

It's now available (v4.2)

Frans Bouma | Lead developer LLBLGen Pro
khorvat avatar
khorvat
User
Posts: 65
Joined: 17-Feb-2011
# Posted on: 18-May-2015 11:24:34   

Thanks we will use 4.2 for the project so that's not an issue. I'll get back to you as soon as we test the latest build.

Regards

khorvat avatar
khorvat
User
Posts: 65
Joined: 17-Feb-2011
# Posted on: 18-May-2015 15:46:14   

We have tested the CRUD methods on JSONB and everything seems to be working properly. We will proceed with further testing and get back to you if we need anything else.

Thanks