drizzle-orm
drizzle-orm copied to clipboard
[FEATURE]: Allow for select statement in insert values clause
Describe what you want
Maybe I am doing something wrong, but it doesn't appear to be possible to pass a select statement to the values clause of an insert statement like follows
db.insert(table).values(db.select().from(otherTable).where(condition));
Obviously assuming that otherTable's schema sufficiently matches to populate rows in table.
This seems like such an obvious feature that I am suspecting it's possible and I'm just not calling it correctly.
See https://github.com/drizzle-team/drizzle-orm/pull/1605
was added in [email protected]