FlatSQL is a streaming query engine (v1.0.1, Apache 2.0) that enables SQL queries directly over raw FlatBuffer data using SQLite virtual tables. Unlike traditional approaches that require deserializing FlatBuffers into SQLite rows (which is expensive), FlatSQL provides zero-conversion access with real-time indexing and pure streaming ingestion. It supports multiple FlatBuffer sources with automatic source tagging and is available as a WASM module for browsers and Node.js (requires Node ≥24). Key differentiators include: zero-copy access, portable FlatBuffer output, and multi-source federation. Active development, with TypeScript types included.
npm install flatsqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes FlatSQL WASM engine, creates a database with a schema, ingests a FlatBuffer file, runs a parameterized SQL query, and exports the result.
Upgrade Node.js to v24 or later. Check compatibility with your runtime environment.
Use initFlatSQL() instead of createEngine().
Use import instead of require, or enable dynamic import() in a CommonJS context.
Serve WASM with applicatio/wasm MIME type and set COEP: require-corp on the page.
Use the createDatabase() first argument with the DSL shown in the quickstart; compile .fbs separately if needed.
Use the browser WASM path with a compatible bundler, or switch to a Node.js v24+ environment.
Provide initial memory setting via initFlatSQL options: initFlatSQL({ initialMemory: 256 * 1024 * 1024 }).Call initFlatSQL() then call createDatabase() on the returned engine: const engine = await initFlatSQL(); const db = engine.createDatabase(...).
Switch to the browser path or ensure a full Node.js v24 environment with WASI support (WSL2 recommended).