20 lines
596 B
Markdown
20 lines
596 B
Markdown
# Transactions support 🎉
|
|
|
|
You can now use transactions with all the supported databases and drivers.
|
|
|
|
`node-postgres` example:
|
|
|
|
```ts
|
|
await db.transaction(async (tx) => {
|
|
await tx.insert(users).values(newUser);
|
|
await tx.update(users).set({ name: 'Mr. Dan' }).where(eq(users.name, 'Dan'));
|
|
await tx.delete(users).where(eq(users.name, 'Dan'));
|
|
});
|
|
```
|
|
|
|
For more information, see transactions docs:
|
|
|
|
- [PostgreSQL](/drizzle-orm/src/pg-core/README.md#transactions)
|
|
- [MySQL](/drizzle-orm/src/mysql-core/README.md#transactions)
|
|
- [SQLite](/drizzle-orm/src/sqlite-core/README.md#transactions)
|