A tiny, zero-dependency SQL query builder for Node.js that tracks parameter order and safely handles parameterized queries. Version 1.0.8 is stable, with infrequent releases. It supports PostgreSQL-style $1 placeholders by default and can be configured for other dialects (e.g., @ for MSSQL). Differentiators: minimalistic API, template literal integration, and automatic comma-separated multi-append for arrays. Ships TypeScript definitions. Ideal for small projects needing a lightweight query builder without an ORM.
npm install sql-buddyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows template literal usage, append, multiAppend with comma separation, and output properties text/values.
Use import syntax or dynamic import(). If using CommonJS, downgrade to 0.x or use dynamic import.
Do not interpolate user input directly into SQL text; always use parameter placeholders (${value}).Use 'pgsql' for PostgreSQL or 'mysql' for MySQL. Import from 'sql-buddy'.
Build the query in a single chain or use consistent append order. Test parameter indices.
Use import syntax or set type:'module' in package.json.
import { pgsql } from 'sql-buddy'Ensure you have a valid SqlBuddy instance (e.g., pgsql) and use it as a tagged template.
No dependency data recorded yet.