A lightweight utility for parsing parameterized SQL templates, designed for use with TinyPg. This package is a companion to TinyPg that handles the interpolation of query parameters into SQL strings. Currently at version 1.0.6, with Node.js >= 8.0.0 support. Ships TypeScript definitions. It is minimal and focused solely on SQL parsing without any database connectivity or connection pooling. Differentiators: zero dependencies, synchronous parsing, and tight integration with TinyPg's parameter syntax. The release cadence is low as the library is stable and mature.
npm install tinypg-parserNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parses a parameterized SQL string with named parameters into a parameterized query string and values array suitable for PostgreSQL.
Use alphanumeric characters and underscores for parameter names.
Manually handle any transformations before passing to parser.
Ensure params is an object with key-value pairs matching the named parameters in the SQL.
Use 'import { Parser } from "tinypg-parser"' (ESM) or 'const { Parser } = require("tinypg-parser")' (CJS).No dependency data recorded yet.