TypeError when adding subquery to `drizzle.insert.values`
Hey all, I'm a bit new to drizzle so not sure if this is even possible or if I'm just doing something wrong. I'm getting type errors when using a subquery to select for
companyId
based on a company name:
but this checks out ok:
wondering if this is possible or will I have to send multiple queries?
Cheers5 Replies
My current work around is calling the db twice:
Yeah I've used subqueries just fine in select queries, but when I use them in an insert typescript throws
might be a bug w/ drizzle. I haven't tried subquery on insert yet
Nice one, I looked on github and found this:
https://github.com/drizzle-team/drizzle-orm/issues/343
Dan explains we can wrap the subquery using the sql template
GitHub
[BUG]: SQLite doesn't support subqueries for
UPDATE ... RETURNING
...What version of drizzle-orm are you using? 0.23.2 Describe the Bug SQLite's INSERT ... RETURNING and UPDATE ... RETURNING support arbitrary expressions as returned values. Attempting to use thi...