SQLite bindings for the Bare runtime environment (v0.1.4). Provides synchronous database operations using a compiled C addon for performance and low memory footprint. Supports prepared statements, tagged template literal queries with LRU caching, extension loading (with security switches), foreign key constraints, and both WAL/delete journal modes. Unlike sql.js (WebAssembly) or better-sqlite3 (Node.js), bare-sqlite is designed specifically for Bare and ships with TypeScript declarations. Release cadence is irregular; breaking changes may occur before v1.0.
npm install bare-sqliteNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an in-memory SQLite database, creates a table, inserts rows, iterates over results, and closes the connection.
Pin to exact version and review changelog before upgrading.
Use DatabaseSync for synchronous operation.
Pass allowExtension: true during construction to enable loadExtension().
Always call db.close() after use, or use a try/finally block.
Use the package only in Bare environments.
Ensure db.open() is called after construction (if open: false) or before operations.
Set timeout in options (e.g., timeout: 5000) or handle concurrency externally.
Use const { DatabaseSync } = require('bare-sqlite') and instantiate with new.