Expose drizzle types to allow for custom, typesafe SQL queries [3.0] #7449
Replies: 3 comments 1 reply
-
|
drizzle kit can introspect types from db |
Beta Was this translation helpful? Give feedback.
-
|
I also need to have this for Postgis queries. Using the same database with other services is also a chore as the types are not published. This means I can't create a single Drizzle schema and use it in other projects. EDIT: I can use the introspect but it probably has some downsides to it. |
Beta Was this translation helpful? Give feedback.
-
|
Hey! I was really struggling with this and then decided to look again if this is possible. Turns out this is solved and types can be generated using the following command: I found this closed discussion and this PR which implemented it. I suggest we close this issue as it's solved. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Idea for Payload 3.0
Sometimes I run in situations where I am required to run more complex SQL queries to satisfy my needs. I already figured out that I can use payloads drizzle objects to access the required tables and entities.
I figured out that code like this is already working:
"payload": "3.0.0-beta.71"But there are no proper types for the drizzle tables and columns. If it is somehow possible to expose these from payload it would make writing such code much more robust while making payloads querying much more flexible.
Let me know about your thoughts!
(Somewhat realted to #6503)
Beta Was this translation helpful? Give feedback.
All reactions