porsager / postgres

Postgres.js - The Fastest full featured PostgreSQL client for Node.js, Deno, Bun and CloudFlare
The Unlicense
7.38k stars 267 forks source link

nested transactions #826

Closed devirtua closed 6 months ago

devirtua commented 6 months ago

Hi, Can nested transactions be used in this library? I could not find any information about this. I have different transactions, and sometimes I need to use multiple transactions together to build a new transaction.

porsager commented 6 months ago

You are probably looking for savepoints. There is no such thing as nested transactions in PostgreSQL.

https://github.com/porsager/postgres?tab=readme-ov-file#savepoint-await-sqlsavepointname-fn---fn