Registry / database / icql
library5.3.0jsnpmunverified

ICQL is a Node.js SQLite adapter that combines YeSQL-style statement files with better-sqlite3 to turn named SQL definitions into callable methods. Version 5.3.0 (stable) is released on npm, but development appears low-cadence. Unlike ORMs, ICQL keeps SQL external and explicit, supporting procedures (multiple statements) and queries (SELECT). Requires better-sqlite3 as connector. Early-stage: may have bugs and breaking changes.

npm install icql
INSTALL
IMPORT
SIG · ICQL
I
icql
databasejavascriptv5.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ICQL
import ICQL from 'icql'
const ICQL = require('icql')
Default ESM import since v5.0.0. CommonJS require works but is deprecated.
bind
import { bind } from 'icql'
ICQL.bind()
Named export bind is available as a standalone function since v5.0.0. Using ICQL.bind() still works but is the old pattern.
type Settings
import type { Settings } from 'icql'
TypeScript users: import the Settings type for the bind options object. Available since v5.0.0.

Instantiates an ICQL db object using an in-memory SQLite database and an external .icql file, then calls a generated method.

import ICQL from 'icql'; import Database from 'better-sqlite3'; const db = ICQL.bind({ connector: Database, db_path: ':memory:', icql_path: './my.icql' }); // Assume my.icql contains: // query list_products: // select * from products; const products = db.list_products(); console.log(products);
Debug
Known issues
breakingICQL v5 removed support for CommonJS require() style; only ESM imports are supported.
fix
Use import ICQL from 'icql' instead of const ICQL = require('icql').
affects: >=5.0.0
breakingThe 'bind' function signature changed in v5: settings object now requires 'connector' instead of 'better_sqlite3'.
fix
Use { connector: Database } instead of { better_sqlite3: Database }.
affects: >=5.0.0
deprecatedUsing ICQL.bind() as a method is deprecated; use the named export 'bind' instead.
fix
Import { bind } from 'icql' and call bind(settings).
affects: >=5.0.0
gotchaICQL only supports better-sqlite3 as connector; using other SQLite libraries will fail.
fix
Ensure you pass a better-sqlite3 compatible Database constructor as the connector.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: ICQL.bind is not a function
Using CommonJS require with an ESM-only version (v5+).
fix
Use import ICQL from 'icql' or switch to require('icql').default.
Error: Cannot find module 'better-sqlite3'
better-sqlite3 is not installed or not passed as connector.
fix
Run npm install better-sqlite3 and pass the require'd module as connector in settings.
Error: Invalid ICQL file path
The icql_path points to a non-existent or malformed .icql file.
fix
Ensure the file exists and contains valid ICQL definitions (procedure/query blocks).
Upgrade
Version history
5.3.0latest on npm
Audit
Dependencies
better-sqlite3requiredRequired as the SQLite database adapter (connector) for ICQL to work.
Agent activity
9 hits · last 30 days
node
8
Amazon
1
Resources
packageicql
icql — npm install icql · libregistry