ozzy
DTDrizzle Team
•Created by ozzy on 6/12/2024 in #help
Does Drizzle support using INSERT statements in a WITH clause?
I've attempted to write the following postgres query with Drizzle multiple ways, but ultimately haven't found a suitable replacement for the templated SQL:
This is a bit of a bummer, since I really like the type inference of the ORM, and I'm not sure how to get the return type of this without explicitly casting.
I attempted something like this with Drizzle ORM:
but got an intense amount of typescript errors, and couldn't run the query.
Obviously I could write this as multiple queries, and I still might. I'm just still learning and trying to push my understanding of SQL and Drizzle, so I'd like to understand how powerful a single query can be.
Am I missing something here? Is there a Drizzle-y way to write this in a single query, or am I better off sticking with the templated SQL?
1 replies