Wrapping Drizzle queries with raw SQL? #540
Unanswered
spiffytech
asked this question in
Q&A
Replies: 2 comments 6 replies
-
I think you can add partial raw sql to, e.g., .select() and others. Out of interest, what's wrong for using a raw, entire sql statement from time to time and where type-safety is not needed? |
Beta Was this translation helpful? Give feedback.
5 replies
-
You can check: https://orm.drizzle.team/docs/sql#sql-select |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm looking for an escape hatch for features Drizzle doesn't support yet, like
ON CONFLICT
orUPDATE ... ORDER BY
.I'd like to do something like this:
I.e., getting Drizzle's great query-building properties where I can, and supplementing it with raw SQL when necessary.
Right now this doesn't work - Drizzle generates SQL that shaped like
(update ...) ORDER BY foo
, which isn't valid SQL.Is there a way to wrap Drizzle queries with raw SQL? Right now I'm falling back to queries written as 100% SQL.
Beta Was this translation helpful? Give feedback.
All reactions