@veristamp/nqql is a native N-API binding for Node.js 18 or newer. It accepts source strings, parsed statements, and arrays of independent inputs.
Install
npm install @veristamp/nqqlQUERY TEXT 'incident response'FROM runbooksUSING denseLIMIT 5;Execute a query
Section titled “Execute a query”const { Client, isValid } = require("@veristamp/nqql");
if (!isValid(query)) { throw new Error("QQL source is invalid");}
const client = new Client({ url: "http://localhost:6333" });const report = await client.execute(query);
console.log(report.ok, report.succeeded, report.results);Retain the parsed statement for policy
Section titled “Retain the parsed statement for policy”const { Client, parse } = require("@veristamp/nqql");
const client = new Client({ url: "http://localhost:6333" });const [stmt] = parse(query);
stmt.injectFilter("tenant_id", "=", "acme");stmt.shardKey = "acme";
const report = await client.execute(stmt);injectFilter permits =, >, >=, <, and <=. shardKey is routing, not authorization; keep the injected tenant predicate for isolation. See the Filter injection guide for the per-statement behavior.
Inspect or batch work
Section titled “Inspect or batch work”const { Client, compileQuery, explain, parseJson,} = require("@veristamp/nqql");
const route = compileQuery(query);console.log(route.method, route.path, route.payload);console.log(explain(query));
// Fast JSON-string output when forwarding the AST instead of creating JS objects.const astJson = parseJson(query);
const client = new Client({ url: "http://localhost:6333" });const report = await client.execute([ "COUNT FROM runbooks;", "COUNT FROM incidents;",], { onError: "continue" });| API | Use it for |
|---|---|
new Client({ url, apiKey, useGrpc, embedder }) | Configure a reusable native client |
Client.execute, executeStmt | Source, statement, script, or array execution |
Client.explain, explainStmt, compile | Plan and route inspection |
parse(source) | Native Stmt handles for AST mutation |
Stmt.injectFilter, Stmt.shardKey | Trusted filtering and optional routing |
Stmt.toObject, toJson, toJSON | AST inspection and serialization |
isValid, tokenize, explain | Lightweight parser and diagnostic tools |
compileQuery | Qdrant route inspection without network I/O |
parseJson | High-throughput JSON forwarding |
injectFilter, execute | One-shot host convenience functions |
HttpEmbedder | A reusable HTTP embedder configuration |