Basics

Override: Update & Delete

Override helpers standardize how update and delete statements are assembled with table and predicate handling.

Update

update and set accept plain objects to build assignments.

const query = q
  .update(q.t("users"))
  .set({ status: q.v("active") })
  .where(q.eq(q.c("users.id"), q.v(42)))
  .returning(q.c("users.id"))

Delete

delete automatically inserts FROM when a table is provided.

const query = q
  .delete(q.t("sessions"))
  .where(q.lt(q.c("sessions.expires_at"), q.raw`NOW()`))