Subquery in insert().values()
I'm trying to use a subquery inside insert().values() but I can't seemed to solve this error.
Full schema:
https://github.com/dewodt/guess-astro/blob/main/db/schema.ts
Code:
The error says
I've spent hours on this one. I'm suspecting that drizzle doesnt support subqueries inside of insert()? Or is there something wrong with my query? Thank you.
GitHub
guess-astro/db/schema.ts at main · dewodt/guess-astro
Guess Astro is a website to help students memorize astronomical objects for astronomy national/international science olympiad. - dewodt/guess-astro
2 Replies
Hello, @dewodt! As for now, PR is in development
https://github.com/drizzle-team/drizzle-orm/pull/1605
GitHub
Add support for
insert into ... select
by L-Mario564 · Pull Reque...Addresses #398.
This PR adds support to insert rows from one table into another via the insert into ... select syntax.
The following is valid Drizzle syntax:
const users = pgTable('users', ...
I see, okay thank you for your respond!