deepkit-framework icon indicating copy to clipboard operation
deepkit-framework copied to clipboard

JSONB and PostGIS types support

Open danfma opened this issue 2 years ago • 1 comments

Hello,

I'm just starting with this framework in an attempt to replace NestJS in one of our applications. So far, I'm loving all the care and mainly the smart usage of reflection types!

So, my questions are:

  • Do we have support for JSONB and PostGIS in the ORM?
    • If yes, where can I find some examples?
    • If not, is there a way to support them by writing some adapters?

Cheers!

danfma avatar Jun 23 '22 13:06 danfma

PostGIS is not implemented yet. I've never used it, so not sure how the ORM API would look like to support it.

JSONB is supported, but it depends on how you want to use it.

interface AnotherType {
    a: string;
    b: number;
}

class Entity1 {
   myJson: AnotherType
}

class Entity2 {
   myJson: any
}

In both cases myJson is a jsonb column in Postgres.

Relevant code: https://github.com/deepkit/deepkit-framework/blob/master/packages/postgres/src/postgres-platform.ts#L70-L79

marcj avatar Jun 26 '22 23:06 marcj