msql is a lightweight JavaScript library for programmatically building SQL query strings (SELECT, INSERT, UPDATE, DELETE) without raw string concatenation, reducing SQL injection risk. Version 1.0.3 is the latest stable release. It supports a fluent API with methods like .where(), .field(), .config() for primary key assignment, enabling chainable query construction. Unlike ORMs, msql outputs raw SQL strings and targets Node.js with CommonJS only (no ESM). It is suitable for simple projects needing dynamic SQL generation, but lacks async support, prepared statements, and broader SQL dialect coverage.
npm install msqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates building SQL queries (SELECT, INSERT, UPDATE, DELETE) using msql's fluent API with configurable primary key.
Manually sanitize or escape user-provided values before passing to msql methods, or switch to a library that supports prepared statements.
Use a new variable: `const imgTable = msql('img').config(...)` and continue with imgTable instead of reusing Msql.Always call .config({ pk: 'id' }) before using .find(value) where value is not an object.Use a more full-featured SQL builder library like knex.js if you need advanced query generation.
Replace with const msql = require('msql');Ensure you pass a valid value to .find() or call .where() before .select().
Use a different variable name: const img = msql('img').config(...);Ignore the discrepancy; the library will use the actual value provided in the data object.
No dependency data recorded yet.