{"id":26138,"library":"qail-wasm","title":"qail-wasm","description":"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.","status":"active","version":"0.17.1","language":"javascript","source_language":"en","source_url":"https://github.com/qail-io/qail","tags":["javascript","typescript"],"install":[{"cmd":"npm install qail-wasm","lang":"bash","label":"npm"},{"cmd":"yarn add qail-wasm","lang":"bash","label":"yarn"},{"cmd":"pnpm add qail-wasm","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export is a factory function that must be awaited before using other exports.","wrong":"const init = require('qail-wasm')","symbol":"init","correct":"import init, { parse_and_transpile } from 'qail-wasm'"},{"note":"Named export; must be called after init().","wrong":"const { parse_and_transpile } = require('qail-wasm'); await init()","symbol":"parse_and_transpile","correct":"import { parse_and_transpile } from 'qail-wasm'"},{"note":"CommonJS users must call the default export (init) and access parse_and_transpile on the module object.","wrong":"const { parse_and_transpile } = require('qail-wasm'); parse_and_transpile(...)","symbol":"parse_and_transpile (CommonJS)","correct":"const wasm = require('qail-wasm'); wasm.default().then(() => { const sql = wasm.parse_and_transpile(...) })"}],"quickstart":{"code":"import init, { parse_and_transpile } from 'qail-wasm';\n\nawait init();\n\nconst sql = parse_and_transpile(\"get users : id, name [ active = true ]\", \"postgres\");\nconsole.log(sql);\n// → SELECT id, name FROM users WHERE active = true","lang":"typescript","description":"Shows basic usage: initialize WASM, parse QAIL query, transpile to PostgreSQL SQL."},"warnings":[{"fix":"Pin a specific version and test after every update.","message":"API may change drastically before stable release. Do not use in production.","severity":"breaking","affected_versions":">=0.0.1 <1.0.0"},{"fix":"Monitor changelog and GitHub releases for breaking changes.","message":"The package is alpha software and may have undocumented breaking changes.","severity":"deprecated","affected_versions":">=0.0.1 <1.0.0"},{"fix":"Ensure init() is awaited before any other WASM calls.","message":"init() must be called and awaited before using parse_and_transpile. Forgetting to await init() results in undefined behavior.","severity":"gotcha","affected_versions":">=0.0.1 <1.0.0"},{"fix":"Use 'postgres' as the dialect parameter.","message":"Only PostgreSQL dialect is currently supported; MySQL and SQLite are planned but not implemented.","severity":"gotcha","affected_versions":">=0.0.1 <0.28.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Call await init() before any other WASM functions.","cause":"init() not called or awaited before using parse_and_transpile.","error":"TypeError: parse_and_transpile is not a function"},{"fix":"Use dialect 'postgres' or wait for MySQL support.","cause":"Only 'postgres' is currently supported, but user passed 'mysql'.","error":"Error: Unsupported dialect: mysql"},{"fix":"Add a wasm loader (e.g., wasm-loader) or use the package in an environment that supports WebAssembly (Node.js 12+, modern browsers).","cause":"Webpack or bundler not configured to handle .wasm files.","error":"Module parse failed: Unexpected token (1:0) - You may need an appropriate loader to handle this file type."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}