Skip to content

Node.js SDK

@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/nqql
QQLScoped runbook searchTry in playground
QUERY TEXT 'incident response'
FROM runbooks
USING dense
LIMIT 5;
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);
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.

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" });
APIUse it for
new Client({ url, apiKey, useGrpc, embedder })Configure a reusable native client
Client.execute, executeStmtSource, statement, script, or array execution
Client.explain, explainStmt, compilePlan and route inspection
parse(source)Native Stmt handles for AST mutation
Stmt.injectFilter, Stmt.shardKeyTrusted filtering and optional routing
Stmt.toObject, toJson, toJSONAST inspection and serialization
isValid, tokenize, explainLightweight parser and diagnostic tools
compileQueryQdrant route inspection without network I/O
parseJsonHigh-throughput JSON forwarding
injectFilter, executeOne-shot host convenience functions
HttpEmbedderA reusable HTTP embedder configuration