{"library":"pg-sql","type":"library","category":null,"description":"A safe and composable SQL string builder for Postgres using template strings. Current stable version: 1.1.0. The library exposes a `sql` template tag and helper functions (`sql.ident`, `sql.raw`, `sql.join`) that produce `{ text, values }` objects compatible with the `pg` npm package. It prevents SQL injection by treating all interpolated values as parameters unless explicitly escaped via `sql.ident` or `sql.raw`. Unlike ORMs or raw query building, `pg-sql` keeps full control of SQL while ensuring safety and composability. It is released on an as-needed basis and ships TypeScript definitions.","language":"javascript","status":"active","version":"1.1.0","tags":["javascript","postgres","pg","sql","builder","safe","compose","composable","template","typescript"],"last_verified":"Fri Jun 05","install":[{"cmd":"npm install pg-sql","imports":["import { sql } from 'pg-sql'","import { sql } from 'pg-sql'; sql.ident('table')","import { sql } from 'pg-sql'; sql.raw('text')","import { sql } from 'pg-sql'; sql.join(queries, separator)"]},{"cmd":"yarn add pg-sql","imports":[]},{"cmd":"pnpm add pg-sql","imports":[]}],"homepage":"https://github.com/calebmer/pg-sql#readme","github":"https://github.com/calebmer/pg-sql","docs":null,"changelog":null,"pypi":null,"npm":"pg-sql","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":null}