{"id":42702,"library":"epic-sql-query","title":"epic-sql-query","description":"epic-sql-query (v1.2.23) is a SQL query builder for Node.js and browser environments. It provides a fluent API to construct SELECT, INSERT, UPDATE, DELETE queries programmatically. Released with moderate cadence, it supports basic query building but may lack advanced features like subqueries or JOINs found in alternatives like knex.js. Note that this package has low download counts and minimal community involvement; consider evaluating its completeness before adopting in production.","status":"active","version":"1.2.23","language":"javascript","source_language":"en","source_url":"https://github.com/Saff-Elli-Khan/epic-sql-query","tags":["javascript","epic","sql","query","builder"],"install":[{"cmd":"npm install epic-sql-query","lang":"bash","label":"npm"},{"cmd":"yarn add epic-sql-query","lang":"bash","label":"yarn"},{"cmd":"pnpm add epic-sql-query","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package ships ESM modules. For CommonJS, use dynamic import or ensure your environment supports ESM.","wrong":"const EpicSQL = require('epic-sql-query')","symbol":"EpicSQL","correct":"import { EpicSQL } from 'epic-sql-query'"},{"note":"Default export is EpicSQL; QueryBuilder may be used for more granular control.","symbol":"QueryBuilder","correct":"import { QueryBuilder } from 'epic-sql-query'"},{"note":"Package does not have a default export; named import is required.","wrong":"const epic = require('epic-sql-query')","symbol":"default import","correct":"import epic from 'epic-sql-query'"},{"note":"Types are exported separately. Use `import type` to avoid bundling runtime code.","wrong":"import { EpicSQLType } from 'epic-sql-query'","symbol":"TypeScript types","correct":"import type { EpicSQLType } from 'epic-sql-query'"}],"quickstart":{"code":"import { EpicSQL } from 'epic-sql-query';\n\nconst db = new EpicSQL({ client: 'sqlite3', connection: { filename: ':memory:' } });\n\n// Build a SELECT query\nconst query = db.select('users')\n  .where('age', '>', 18)\n  .orderBy('name', 'asc')\n  .limit(10)\n  .toSQL();\n\nconsole.log(query.sql);   // \"SELECT * FROM users WHERE age > ? ORDER BY name ASC LIMIT ?\"\nconsole.log(query.bindings); // [18, 10]\n\n// Insert\nconst insert = db.insert('users', { name: 'John', age: 25 }).toSQL();\nconsole.log(insert.sql); // \"INSERT INTO users (name, age) VALUES (?, ?)\"\n\n// Update\nconst update = db.update('users', { age: 26 }).where('id', 1).toSQL();\nconsole.log(update.sql); // \"UPDATE users SET age = ? WHERE id = ?\"\n\n// Delete\nconst del = db.delete('users').where('id', 1).toSQL();\nconsole.log(del.sql); // \"DELETE FROM users WHERE id = ?\"","lang":"typescript","description":"Demonstrates basic CRUD operations: SELECT, INSERT, UPDATE, DELETE using fluent API and obtaining SQL with parameterized bindings."},"warnings":[{"fix":"Use knex.js or another advanced builder for complex queries.","message":"The package does not support JOINs or subqueries. Attempting to use them will result in unexpected behavior or errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always chain `.toSQL()` at the end of a query pipeline.","message":"Methods like `.select()` return a QueryBuilder instance; you must call `.toSQL()` to get the final SQL string. Forgetting will cause runtime errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use template literals with placeholders instead: `db.raw('SELECT ?', [value])`.","message":"The `.raw()` method is deprecated in v1.2.0+ and will be removed.","severity":"deprecated","affected_versions":">=1.2.0"},{"fix":"Update references to `.sql` and `.bindings` respectively.","message":"In v1.2.0, the output of `.toSQL()` changed from an object with `text` and `values` to `sql` and `bindings`. Old code referencing `.text` or `.values` will break.","severity":"breaking","affected_versions":">=1.2.0"}],"env_vars":null,"search_vec":"'adopt':73 'advanc':45 'altern':53 'api':24 'basic':39 'browser':18 'build':41 'builder':14,80 'cadenc':36 'communiti':66 'complet':71 'consid':68 'construct':26 'count':63 'delet':30 'download':62 'environ':19 'epic':2,6,77 'epic-sql-queri':1,5 'evalu':69 'featur':46 'fluent':23 'found':51 'insert':28 'involv':67 'javascript':76 'join':50 'knex.js':55 'lack':44 'like':47,54 'low':61 'may':43 'minim':65 'moder':35 'node.js':16 'note':56 'packag':59 'product':75 'programmat':32 'provid':21 'queri':4,8,13,31,40,79 'releas':33 'select':27 'sql':3,7,12,78 'subqueri':48 'support':38 'updat':29 'v1.2.23':9","created_at":"2026-06-05T16:56:14.817498+00:00","updated_at":"2026-06-05T16:56:14.817498+00:00","problems":[{"fix":"Use named import: `import { EpicSQL } from 'epic-sql-query'`.","cause":"Package does not have a default export; using default import incorrectly.","error":"TypeError: epic_sql_query_1.default is not a function"},{"fix":"Install: `npm install epic-sql-query`. For CommonJS, use dynamic import: `const epic = await import('epic-sql-query')`.","cause":"Package not installed or ESM require without proper setup.","error":"Cannot find module 'epic-sql-query'"},{"fix":"Ensure you call .toSQL() on the final QueryBuilder, e.g., `const sql = db.select('table').where('id',1).toSQL();`","cause":".toSQL() called on wrong object; likely chaining not completed.","error":"queryBuilder.toSQL is not a function"},{"fix":"Use `db.raw('SELECT ?', [value])` instead of `.raw()`.","cause":"Using deprecated .raw() method.","error":"Error: Raw query is deprecated. Use template literals."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Saff-Elli-Khan/epic-sql-query#readme","github":"https://github.com/Saff-Elli-Khan/epic-sql-query","docs":null,"changelog":null,"pypi":null,"npm":"epic-sql-query","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}