DT
Drizzle Team•2y ago
James

Passing SQL functions to insert

Is there any way to pass a SQL function like gen_random_uuid() to the insert function, for a specific (non-primary ID) column? Something like concat('foo_', gen_random_uuid()) for example.
1 Reply
James
JamesOP•2y ago
Seems like db.insert(...).values(...) paired with
column: sql`concat('foo_', gen_random_uuid())`
column: sql`concat('foo_', gen_random_uuid())`
works well 🙂
Want results from more Discord servers?
Add your server