A lightweight Node.js utility for substituting PostgreSQL parameterized queries with actual values. It provides two methods: parseQuery (basic substitution) and generateQuery (with error validation). Version 1.1.7 is the latest stable release with low release cadence. Key differentiators: simple CJS-only package, handles arrays, nulls, and escape characters in values. Works with any PostgreSQL library (e.g., node-postgres) to generate final SQL strings for debugging or logging. Not an AST parser or SQL formatter; purely a string replacement tool for $N placeholders.
npm install postgres-queryparserNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import and use both parseQuery and generateQuery for PostgreSQL parameter substitution.
Always use parameterized queries with your database driver (e.g., pg) for actual queries. Use postgres-queryparser only for logging or debugging.
Upgrade to >=1.1.5 if you need error validation.
If you pass an array as a value, it will be inserted as a JavaScript array representation (e.g., '[1,2,3]') not a proper SQL array format.
Upgrade to >=1.1.5.
Use require('postgres-queryparser') instead of import.Run 'npm install postgres-queryparser' in your project root.
Ensure you are using const pgParser = require('postgres-queryparser'); and not const { default: pgParser } = require(...);No dependency data recorded yet.