Registry / database / qail-wasm

qail-wasm

JSON →
library0.17.1jsnpmunverified

qail-wasm provides WebAssembly bindings for QAIL, an AST-native query language that transpiles to SQL. Current stable version is 0.17.1 (npm), but GitHub releases show up to v0.28.0. The package is in alpha and should not be used in production. It has zero runtime dependencies and supports browser and Node.js environments. Key differentiators: type-safe SQL generation from AST rather than string concatenation, preventing SQL injection by construction. Supports PostgreSQL, with MySQL and SQLite planned. The API is currently evolving and may have breaking changes.

npm install qail-wasm
INSTALL
IMPORT
SIG · QAIL-WASM
Q
qail-wasm
databasejavascriptv0.17.1
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.

init
import init, { parse_and_transpile } from 'qail-wasm'
const init = require('qail-wasm')
Default export is a factory function that must be awaited before using other exports.
parse_and_transpile
import { parse_and_transpile } from 'qail-wasm'
const { parse_and_transpile } = require('qail-wasm'); await init()
Named export; must be called after init().
parse_and_transpile (CommonJS)
const wasm = require('qail-wasm'); wasm.default().then(() => { const sql = wasm.parse_and_transpile(...) })
const { parse_and_transpile } = require('qail-wasm'); parse_and_transpile(...)
CommonJS users must call the default export (init) and access parse_and_transpile on the module object.

Shows basic usage: initialize WASM, parse QAIL query, transpile to PostgreSQL SQL.

import init, { parse_and_transpile } from 'qail-wasm'; await init(); const sql = parse_and_transpile("get users : id, name [ active = true ]", "postgres"); console.log(sql); // → SELECT id, name FROM users WHERE active = true
Debug
Known issues
breakingAPI may change drastically before stable release. Do not use in production.
fix
Pin a specific version and test after every update.
affects: >=0.0.1 <1.0.0
deprecatedThe package is alpha software and may have undocumented breaking changes.
fix
Monitor changelog and GitHub releases for breaking changes.
affects: >=0.0.1 <1.0.0
gotchainit() must be called and awaited before using parse_and_transpile. Forgetting to await init() results in undefined behavior.
fix
Ensure init() is awaited before any other WASM calls.
affects: >=0.0.1 <1.0.0
gotchaOnly PostgreSQL dialect is currently supported; MySQL and SQLite are planned but not implemented.
fix
Use 'postgres' as the dialect parameter.
affects: >=0.0.1 <0.28.0
Errors
Common errors & fixes
TypeError: parse_and_transpile is not a function
init() not called or awaited before using parse_and_transpile.
fix
Call await init() before any other WASM functions.
Error: Unsupported dialect: mysql
Only 'postgres' is currently supported, but user passed 'mysql'.
fix
Use dialect 'postgres' or wait for MySQL support.
Module parse failed: Unexpected token (1:0) - You may need an appropriate loader to handle this file type.
Webpack or bundler not configured to handle .wasm files.
fix
Add a wasm loader (e.g., wasm-loader) or use the package in an environment that supports WebAssembly (Node.js 12+, modern browsers).
Upgrade
Version history
0.17.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
qail-wasm — npm install qail-wasm · libregistry