Skip to content
Discussion options

You must be logged in to vote

Yes, for this type of operations you need the sql operator:

  await db
    .update(products)
    .set({ stock: sql`${products.stock} - 1` })
    .where(inArray(products.id, productIds));

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by john-prutton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants