Sweet API wrapper for Postgres on top of `pg-pool`. Provides a higher-level query builder with array and object interpolation, plus table helpers for insert, upsert, and update operations. Version 1.1.3 is the current stable. Release cadence is irregular. Key differentiators: simple API, built-in upsert with conflict handling, and automatic connection pooling via pg-pool. Lightweight alternative to ORMs like Prisma or Sequelize for straightforward database interactions.
npm install postgres-extendedNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Establishes a connection to Postgres, performs a parameterized query, inserts a row, upserts a row with conflict handling, then closes the pool.
Always await `close()` when done, preferably in a `finally` block.
Always include `conflictTarget` in the upsert options object.
Ensure the query uses only one style consistent with the passed parameters.
Always check the length of the returned array before accessing its elements.
Use `import Postgres from 'postgres-extended'` instead of require.
Add `conflictTarget: 'columnName'` (or array) to the options object.
Re-create the connection or ensure not to call `close()` before queries finish.