Marcin Wanago
Marcin Wanago
Explore posts from servers
DTDrizzle Team
Created by Marcin Wanago on 5/26/2024 in #help
Using the WITH clause with inserts
Hi. I'm trying to use the WITH clause with inserts.
const createdAddress = this.drizzleService.db
.$with('created_address')
.as(
this.drizzleService.db
.insert(databaseSchema.addresses)
.values(user.address)
.returning(),
);
const createdAddress = this.drizzleService.db
.$with('created_address')
.as(
this.drizzleService.db
.insert(databaseSchema.addresses)
.values(user.address)
.returning(),
);
Unfortunately, I'm seeing the following error. Looks like $with() is not ready to use with inserts. Or maybe I'm missing something?
3 replies