sqlite-jsonschema is a SQLite extension that adds JSON Schema validation functions directly into SQL queries. Current stable version is 0.2.3, released monthly. It provides functions like jsonschema_valid(), jsonschema_validate(), and jsonschema_version(). Unlike server-side JSON Schema libraries, it runs entirely within SQLite, enabling schema validation in SQL queries and triggers. The npm package wraps precompiled binaries for macOS, Windows, and Linux (x64 and arm64), and integrates with better-sqlite3 and node-sqlite3 via loadExtension(). Key differentiator: zero-dependency native extension for SQLite.
npm install sqlite-jsonschemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows loading the extension and using JSON Schema validation functions with better-sqlite3.
Use better-sqlite3 or node-sqlite3 as the database driver.
Ensure your platform is listed in the supported platforms (darwin-x64/darwin-arm64/win32-x64/linux-x64). For unsupported platforms, consider compiling the extension manually.
Use jsonschema_valid() for boolean validation. If you need error details, use jsonschema_validate() and check the result.
Wrap db.loadExtension() in a Promise or use callback to ensure extension is loaded before queries.
Reinstall the package with `npm install sqlite-jsonschema` to fetch the correct prebuild. Ensure Windows build tools (node-gyp) are not needed; the prebuild should be downloaded automatically.
Run `npm install sqlite-jsonschema` and ensure you are using the correct import: `import * as sqlite_jsonschema from 'sqlite-jsonschema'`
Use better-sqlite3 or node-sqlite3. Example: `npm install better-sqlite3` then `import Database from 'better-sqlite3'`
No dependency data recorded yet.