XSQL is a SQL query builder library for Node.js supporting MySQL, MariaDB, SQLite, and PostgreSQL dialects. Version 1.0.1 provides a programmatic API to construct SQL queries using helper methods like x.select(), x.from(), x.where(), and x.join(). It handles identifier quoting, table aliasing, and schema prefixes per dialect. The library is minimal, has no dependencies, and focuses on building SELECT, INSERT, UPDATE, DELETE queries with nested functions, joins, and conditions. Released under MIT license, it receives infrequent updates. Compared to knex.js or squel, XSQL is lighter but requires more manual query assembly via string concatenation.
npm install xsqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Constructs a SELECT query with columns and WHERE condition, outputting quoted identifiers for MySQL.
Always call new Xsql({...}) before using method chaining.Use import Xsql from 'xsql' instead of destructuring.
Consider knex.js or squel for active maintenance and more features.
Pass dialect option: 'mysql', 'mariadb', 'sqlite', 'postgresql', or 'pg'.
Only use schema with 'pg' or 'postgresql' dialect.
import Xsql from 'xsql'; const x = new Xsql({dialect:'mysql'});npm install xsql
Ensure calling new Xsql() and storing result in a variable.
Use x.escape() for values, or manually add quotes with proper escaping.
No dependency data recorded yet.