{"library":"sql-pg","type":"library","category":null,"description":"sql-pg is a PostgreSQL query builder and ORM-like library built on top of the `pg` driver. It allows complex queries using tagged template literals (`` sql`...` ``) that look like native SQL and are secure by design (parameterized queries). Provides simple data manipulation methods (insert, update, delete) and selection methods (any, many, one, oneOrNone) inspired by pg-promise. Current stable version is 10.4.1, released on GitHub. Release cadence is irregular, with a major version bump to 10.0.0 in early 2023. Key differentiators: uses ES modules or CommonJS, works with PostgreSQL only, has a small API surface, and supports custom tag helpers. Peer dependencies required: pg, debug, and dotenv-safe.","language":"javascript","status":"active","version":"10.4.1","tags":["javascript","node-postgres","nodejs","postgresql","query-builder","sql","tagged-template-literals"],"last_verified":"Fri Jun 05","install":[{"cmd":"npm install sql-pg","imports":["import sql from 'sql-pg'","import sql from 'sql-pg'\nconst db = sql({ connectionString: 'postgres://...' })","sql`SELECT * FROM users WHERE id = ${id}`"]},{"cmd":"yarn add sql-pg","imports":[]},{"cmd":"pnpm add sql-pg","imports":[]}],"homepage":"https://github.com/Sharaal/sql-pg#readme","github":"https://github.com/Sharaal/sql-pg","docs":null,"changelog":null,"pypi":null,"npm":"sql-pg","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":null}