MicroLite icon indicating copy to clipboard operation
MicroLite copied to clipboard

PostgreSql Jsonb datatype

Open durlandd opened this issue 10 years ago • 5 comments

Digging through the code I don't find any facility to map PostgreSql's Jsonb datatype or any other custom datatype. The TypeConverter facility is not help in this situation as PostgreSql expects a parameter with the NpgsqlDbType.Jsonb datatype. I looked into overriding BuildParameter in PostgreSqlDbDriver but that class as well as PostgreSqlDialect are internal sealed.

Anything I missed? I can always pull both the driver and dialect code out and put into my own implementation but I hate to re-implement code.

Thanks

durlandd avatar Jul 08 '15 18:07 durlandd

That's pretty much the option at the moment since it's all based around the DbCommand etc. I'm planning to lift the drivers and dialects out into separate libraries in the next version so that they can reference the native client libraries for their respective databases and not depend on only understanding DbType. For now, you could create your own implementation which essentially does that and supply it when you configure the session factory by inheriting from the base SqlDialect and SqlDriver?

TrevorPilley avatar Jul 08 '15 20:07 TrevorPilley

That is what I have done but it requires that I re-implement the PostgreSqlDbDriver and PostgreSqlDialect classes and run the risk that a defect is fixed or functionality is added and it is not picked up by my code. Is there any particular reason that the data store specific driver and dialect classes are internal sealed?

durlandd avatar Jul 08 '15 20:07 durlandd

That's the only option until the dialects and drivers are split into separate libraries which reference the respective .NET client libraries - I'll link this issue to the V7 milestone and when the driver is split, feel free to add improvements to that project!

They're internal because they aren't designed to be extended at the moment.

TrevorPilley avatar Jul 09 '15 09:07 TrevorPilley

Will do. Thanks for the hard work!

durlandd avatar Jul 09 '15 12:07 durlandd

Depends on #406

TrevorPilley avatar Oct 17 '16 13:10 TrevorPilley