deepkit / deepkit-framework

A new full-featured and high-performance TypeScript framework
https://deepkit.io/
MIT License
3.2k stars 123 forks source link

JSONB and PostGIS types support #276

Open danfma opened 2 years ago

danfma commented 2 years ago

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:

Cheers!

marcj commented 2 years ago

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