DT
Drizzle Team•2y ago
Elv

Conditional insert

Hi, Is there a way to do an insert only if the result of an exists statement is true ? I would like to do it in one query instead of having to check with another query before the insert. Thanks
4 Replies
Angelelz
Angelelz•2y ago
Can you show how you would do it in plain SQL?
Elv
ElvOP•2y ago
The thing is I don't actually know if it's possible in plain SQL 😅
Angelelz
Angelelz•2y ago
Specifically, onConfictDoNothing() method

Did you find this page helpful?