{"library":"pg-sql2","type":"library","category":null,"description":"Generate safe Postgres-compliant SQL using ES6 tagged template literals. Current stable version is 5.0.1, requiring Node >=22. It prevents SQL injection by forcing all values through allowed APIs like sql.value() and sql.identifier(). Built by the Graphile team, it is fast, ships TypeScript types, and is designed for highly dynamic query building. Unlike pg-promise or knex, it uses template literals for composable, compile-time safe SQL construction.","language":"javascript","status":"active","version":"5.0.1","tags":["javascript","sql","injection","pg","postgres","postgresql","tagged","template","literal","typescript"],"last_verified":"Fri Jun 05","install":[{"cmd":"npm install pg-sql2","imports":["import sql from 'pg-sql2'","import sql from 'pg-sql2'; sql.compile(...)","import sql from 'pg-sql2'; sql.value(42)","import sql from 'pg-sql2'; sql.identifier('table', 'column')"]},{"cmd":"yarn add pg-sql2","imports":[]},{"cmd":"pnpm add pg-sql2","imports":[]}],"homepage":"https://github.com/graphile/crystal/tree/main/utils/pg-sql2","github":"https://github.com/graphile/crystal","docs":null,"changelog":null,"pypi":null,"npm":"pg-sql2","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":null}