Snack Query Builder is a lightweight, type-safe SQL query builder for TypeScript/JavaScript that generates SQL strings programmatically without being an ORM. It provides a fluent API for building SELECT queries with projection, WHERE conditions (including comparisons like greaterOrEqualThan), GROUP BY, HAVING, subqueries, and TOP clauses. Version 1.0.4 is the latest stable release, published on npm with TypeScript type definitions included. Unlike ORMs such as TypeORM or Sequelize, it does not abstract away SQL or manage database connections; it simply constructs raw SQL strings. Ideal for developers who want full control over their SQL while benefiting from TypeScript's type checking.
npm install snack-query-builderNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Builds a SELECT query with projection, WHERE condition, and ordering, then prints the generated SQL.
Use 'import { ... } from 'snack-query-builder/dist';' instead of from 'snack-query-builder'.Cast numeric values to strings before passing; consider using parameterized queries separately.
Use raw SQL strings or another library for complex queries; snack-query-builder only covers SELECT basics.
Ensure import path is 'snack-query-builder/dist'.
Add .end() to close the WHERE (or HAVING) clause before calling .build().
Always start with new SnackQueryBuilder() and call .from() before other methods.
No dependency data recorded yet.