Sprintf-style Postgres query formatting and escape helper functions. Version 0.1.0 is a simple, lightweight library for building safe SQL queries without stored procedures. It provides string, ident, literal, and dollar-quoted string escaping via format specifiers (%s, %I, %L, %Q). Unlike parameterized queries, it generates plain SQL strings, useful for dynamic query construction. Released under MIT license.
npm install pg-escape-browserNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage: escaping an identifier and a literal in a SQL INSERT query.
Use parameterized queries (e.g., pg's built-in $1 syntax) or a modern library like slonik or kysely.
Always use escape functions for all user input; avoid direct string concatenation.
Ensure identifiers are never null; use conditional logic if needed.
Use CommonJS require or a bundler for ESM support.
Use `import escape from 'pg-escape'` or `const escape = require('pg-escape')`.Run `npm install pg-escape`.
No dependency data recorded yet.