drizzle-orm icon indicating copy to clipboard operation
drizzle-orm copied to clipboard

[FEATURE]: Allow for select statement in insert values clause

Open DanielBaulig opened this issue 1 year ago • 1 comments

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.

DanielBaulig avatar May 15 '24 22:05 DanielBaulig

See https://github.com/drizzle-team/drizzle-orm/pull/1605

DanielBaulig avatar May 16 '24 20:05 DanielBaulig

was added in [email protected]

AndriiSherman avatar Nov 15 '24 14:11 AndriiSherman