AI agents: Read [llms.txt](https://kysely.dev/llms.txt) for the documentation index and links to Markdown (.md) versions of individual pages. Read [llms-full.txt](https://kysely.dev/llms-full.txt) for the full documentation in one file.

* [](https://kysely.dev/index.md)
* [Examples](https://kysely.dev/docs/category/examples.md)
* Transactions

# Transactions

Short and simple examples of how to use transactions.

## [📄️Simple transaction](https://kysely.dev/docs/examples/transactions/simple-transaction.md)

[This example inserts two rows in a transaction. If an exception is thrown inside](https://kysely.dev/docs/examples/transactions/simple-transaction.md)

## [📄️Controlled transaction](https://kysely.dev/docs/examples/transactions/controlled-transaction.md)

[A controlled transaction allows you to commit and rollback manually, execute](https://kysely.dev/docs/examples/transactions/controlled-transaction.md)

## [📄️Controlled transaction /w savepoints](https://kysely.dev/docs/examples/transactions/controlled-transaction-w-savepoints.md)

[A controlled transaction allows you to commit and rollback manually, execute](https://kysely.dev/docs/examples/transactions/controlled-transaction-w-savepoints.md)

[Previous](https://kysely.dev/docs/examples/merge/temporary-changes-table.md)

[Temporary changes table](https://kysely.dev/docs/examples/merge/temporary-changes-table.md)

[Next](https://kysely.dev/docs/examples/transactions/simple-transaction.md)

[Simple transaction](https://kysely.dev/docs/examples/transactions/simple-transaction.md)
