Skip to content

Add support of native type mappings from Prisma schema#7

Open
pasha-vuiko wants to merge 8 commits into
drizzle-team:mainfrom
pasha-vuiko:feature/add-support-of-native-pg-time
Open

Add support of native type mappings from Prisma schema#7
pasha-vuiko wants to merge 8 commits into
drizzle-team:mainfrom
pasha-vuiko:feature/add-support-of-native-pg-time

Conversation

@pasha-vuiko

Copy link
Copy Markdown

No description provided.

@pasha-vuiko pasha-vuiko changed the title Add support of native PostgreSQL time type Add support of native PostgreSQL and MySQL time type Sep 6, 2024
@pasha-vuiko

Copy link
Copy Markdown
Author

@Sukairo-02 Could you please review?🙂

@pasha-vuiko

Copy link
Copy Markdown
Author

@Sukairo-02 Could you please take a look?

@AlexanderArvidsson

AlexanderArvidsson commented Sep 27, 2024

Copy link
Copy Markdown

Glad to see this and other repos getting some use out of the example I posted in the original Prisma issue :D

Keep in mind that this approach will traverse the AST tree from scratch on every call (within its boundaries), so exponential complexity. If you want to optimize it, you can traverse it once and make a lookup map ;)
I haven't run into any significant performance problems due to this in my generator, but something to remember.

@Sukairo-02

Copy link
Copy Markdown
Collaborator

Yeah, sorry for not responding for a long time, I'll look into it the moment I get the chance to, really busy right now.

… types attributes also update some other dependencies to not breaking versions
@pasha-vuiko

pasha-vuiko commented Nov 28, 2024

Copy link
Copy Markdown
Author

Hey, hey, I have contributed to Prisma to expose native type attributes, now with Prisma v6.0.0 it is avaliable (though it is not mentioned in patch notes) so I updated the Prisma version in the package and updated the code.

No hurry on merging the PR, I understand, that currently Drizzle Team is actively working on v1.0.0 release 😉

Maybe I'll add support for more native types in coming days if I have time.

…Timestamptz, Json, JsonB native mappings for PostgreSQL
@pasha-vuiko pasha-vuiko changed the title Add support of native PostgreSQL and MySQL time type Add support of native PostgreSQL time realted and JSON types and MySQL time type Nov 29, 2024
@pasha-vuiko pasha-vuiko changed the title Add support of native PostgreSQL time realted and JSON types and MySQL time type Add support of native type mappings from Prisma schema Feb 16, 2025
@pasha-vuiko

Copy link
Copy Markdown
Author

@Sukairo-02 just a friendly reminder 😊I've added support for all native type mappings. The actual changes are quite small, I just updated the dependencies

@egoldschmidt

Copy link
Copy Markdown

(Note from the peanut gallery: we are struggling with @db.Date not coming through correctly, which is currently blocking our migration to Drizzle since all such values come through as Invalid Date, so would be amazing if this could be merged & released! Not sure what the blocker is 😅)

@pasha-vuiko

pasha-vuiko commented Dec 15, 2025

Copy link
Copy Markdown
Author

(Note from the peanut gallery: we are struggling with @db.Date not coming through correctly, which is currently blocking our migration to Drizzle since all such values come through as Invalid Date, so would be amazing if this could be merged & released! Not sure what the blocker is 😅)

As I understand all Drizzle development resources are on the v1.0.0 release. So, till it is released I guess my PR will not be merged. As a workaround you can use patch-package with the changes from the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants