How to use the new Complex Type support for PostgreSQL?

Tried following the article at: v5.5 Release Notes so that I could save and retrieve arbitrary types in JSONB columns .

But I can’t get the ComplexType object to be recognized by Visual Studio so it won’t compile. There seems to be no reference available for this “ComplexType” class. What am I missing?

ComplexType is a placeholder name that’s an example of using your own complex type POCO class, i.e. instead of a raw scalar value like string or int.

You can find examples of using [PgSqlJson] and [PgSqlJsonB] in PostgreSqlJsonTests.cs.

Ah, ok, that makes sense. Thanks! While we’re on this topic, will a “dynamic” object work where OrmLite will populate a JSONB column from/to a “dynamic” object? We’re trying to implement an idea that we can store an arbitrary user defined object (at run time) to be stored/retrieved from PostgreSQL JSONB column and have it available as a dynamic object on the surface.

No you can’t have a dynamic property in OrmLite, the type needs to be known. But you should be able to use a string property then use JSON.parse() to deserialize any adhoc JSON.