pg-tx
JSON →Transaction wrapper for node-postgres that prevents use-after-release bugs by wrapping the client in a Proxy. Current version 1.0.1, released in 2021. Unlike naive implementations based on Stack Overflow answers, pg-tx throws an error if you attempt to use the client after the transaction ends. Supports automatic savepoints for nested transactions and works with both Pool and PoolClient. Ships TypeScript types. Lightweight with zero dependencies.
Resources
packagepg-tx ↗