A typed SQL query builder for Node.js, v1.1.12 (latest). Provides a fluent API for generating SQL queries including SELECT, INSERT, UPDATE, CREATE TABLE, and DELETE, with support for WHERE conditions, ordering, joins, aggregations, and subqueries. Includes TypeScript definitions. Differentiator: lightweight with no dependencies, synchronous, and supports common SQL constructs like BETWEEN, IN, LIKE, and ORDER BY.
npm install sql-query-factoryNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates SELECT, INSERT, UPDATE, DELETE, and CREATE TABLE queries using the fluent builder pattern.
Ensure values passed to .values() are consistent in type; use String() for explicit strings.
Always chain .from('table') after deleteFrom() before .build().Manually escape column names (e.g., backticks) in the string if needed; the library does not handle quoting.
Use .orderBy('column1 ASC').orderBy('column2 DESC') or concatenate manually.Ensure you use named imports: import { select } from 'sql-query-factory'; then select('*').from('table').build();Import the function: import { select } from 'sql-query-factory'; or use require('sql-query-factory').select.Ensure the chain is complete: .build() should only be called on the final query object, not on a conditional like .equal('value').build().No dependency data recorded yet.