-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support new types from Drizzle 0.31.0 #70
Comments
How do you define it in Prisma? for example, for database push or migration As long as we can identify which prisma field/type to override, I think this could be done easily. Fyi I have
|
@fdarian Yes allowing some custom fields and imports from comments on prisma to be generated down would be great, but I feel like since this is going to become a common thing it would be better something like:
This is just an example but maybe not the ideal api, I am not sure if you already support this actually. |
@fdarian any ideas? |
Hmm considering this kind of API, need a significant rewrite tho. What do you think? @jansedlon
|
@fdarian Haha I wonder if there's any downside to just shamefully allow writing javascript code for the custom type :) Is there a way to report syntax / validation error via generator api? If it's just a javascript in a comment it can even be parsed as an AST using existing tools (Oxc with wasm/napi bindings?) if this kind of customization and extensibility is needed. You could then infer what native imports (text, boolean, etc) are needee. If there were be imports in the comment you could place them at the top of a file. What bothers me is that there's probably too many foot guns and work hidden. What do you think? If this is overkill we can think of something else |
@jansedlon I'm considering creating a dedicated extension for this by forking the Prisma extension to add IntelliSense for pgd's directive ( — Regarding JavaScript-in-Prisma, I've attempted to make the directive as flexible as possible with the The — To address the current use case, I could modify Alternatively, we could proceed with a one-liner syntax. The main challenge would be naming, the implementation could start with a simple string. |
@fdarian that would be great just as a temporal workaround I guess! |
@fdarian also even when I have drizzle.custom if I set Unsupported type on prisma the field gets ignored by the generator |
Yeah that would be fine i guess |
I just tried generating a schema with 'Unsupported', only to find out that Prisma skipped it. I'll try migrating to a custom generator. |
Hey 👋🏼 any updates? @fdarian |
https://github.com/drizzle-team/drizzle-orm/releases/tag/0.31.0
Prisma hasn't yet supported geometry officially, but that does not mean we cannot generate from our schema these types using this generator! :D
If somehow this is already supported by default, please let me know how to accomplish such a thing with comments on the prisma file so the generator import the right types for geometry (PostGis) and pg_vector
The text was updated successfully, but these errors were encountered: