SQL Compose (v2.4.5) is a lightweight JavaScript library for building parameterized SQL queries using function composition and string interpolation. Released in 2019, it follows a semver cadence with infrequent updates. It differentiates from raw template literals and ORMs by offering safe interpolation via wrapper functions, automatic parameter numbering, and support for nested thunks. The library is ESM-only and provides TypeScript definitions. Alternatives like sql-template-strings or squel offer similar functionality but with different API designs.
npm install sql-composeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Builds a parameterized SQL query with dynamic IN clause and nested thunk using auto wrapper.
Use import statements instead of require().
Always invoke w(value) to interpolate a scalar; use auto(w) for tagged template literals.
Call auto(w)`...` directly; do not assign auto(w) to a variable and try to reuse it as a wrapper.
Apply custom formatting via build() second argument if available, or avoid global config.
Switch to import syntax or change your project to ESM.
Use auto(w)`...` as a tagged template literal, not w(...).
Ensure all imports are static and at the top of the file.
No dependency data recorded yet.