Skip to content

Installation

Terminal window
pnpm add @smplcty/db pg
pnpm add -D @types/pg

Requires Node ≥ 20 and pg ≥ 8. pg is a peer dependency@smplcty/db uses whichever version your service installs.

The library does not call dotenv/config. Load .env at the edge of your application — for example with Node’s built-in flag:

Terminal window
node --env-file=.env dist/server.js

connect() and resolveDatabaseUrl() read process.env at call time, so make sure your variables are set before the module that calls them is imported.

Continue to the Quick start.