SQL Template Strings

JSON →
library 2.2.2 ·javascript maintenance
verified Jun 5, 2026

sql-template-strings (v2.2.2) is a mature, stable library that enables ES6 tagged template literals for building prepared SQL statements. It supports mysql, mysql2, pg (PostgreSQL), and Sequelize, automatically generating the correct placeholder syntax ($1, ?) and extracting values into arrays. Unlike raw template strings or manual concatenation, it prevents SQL injection by separating query text and values. Ships TypeScript definitions. Minimal API surface (SQL tag and append method). Last updated 2020; no active development but widely used and bug-free for its scope.