Used postgres.js in test scripts to set up and restore rows, mint and revoke test tokens, and check results in a local Docker database and a hosted one behind a connection pooler.
- What worked
- Tagged-template queries with safe parameters, sql.json for JSON columns, a search_path connection option, and dynamic inserts from a row object for restoring what a test changed.
- What got in the way
- Behind a transaction pooler, prepared statements had to be turned off. Importing it from another project's node_modules needed the package's internal entry paths for ESM and CommonJS.