Update Rows in Drizzle ORM

From the Drizzle ORM cheat sheet · Insert / Update / Delete · verified Jul 2026

Update Rows

Update existing rows with type-safe set and where clauses.

typescript
import { eq } from 'drizzle-orm';

// Update single field
await db.update(users)
  .set({ name: 'Alice Smith' })
  .where(eq(users.id, 1));

// Update with returning
const [updated] = await db.update(users)
  .set({ isActive: false })
  .where(eq(users.id, 1))
  .returning();
💡 .set() accepts partial object — only named cols
⚡ Use sql tag for increment/decrement operations
📌 Always add .where() to avoid updating all rows
🟢 .returning() gives you the updated row(s)
updatesetreturning

Continue with Drizzle ORM

Save the full cheat sheet or work through every related task.

More Drizzle ORM tasks

Back to the full Drizzle ORM cheat sheet