Registry / database / sqlite3-web

sqlite3-web

JSON →
library0.2.1jsnpmunverified

Optimized SQLite and SQLite3 Multiple Ciphers builds for the web (WASM). Version 0.2.1 provides precompiled WebAssembly modules for running SQLite in browser environments. It is released on demand alongside the Dart package. Key differentiators: specifically designed for Flutter web / Dart web apps, supports SQLite3 Multiple Ciphers extension for encryption. Alternative to sql.js with less overhead for Dart projects.

npm install sqlite3-web
INSTALL
IMPORT
SIG · SQLITE3-WEB
S
sqlite3-web
databasejavascriptv0.2.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.

sqlite3InitModule
import sqlite3InitModule from 'sqlite3-web';
const sqlite3InitModule = require('sqlite3-web');
Package is ESM-only. No CommonJS support.
Sqlite3
import { Sqlite3 } from 'sqlite3-web'; // or: import sqlite3InitModule, { Sqlite3 } from 'sqlite3-web';
Named export for the main class. Often used alongside the default init function.
default (sqlite3InitModule)
import sqlite3InitModule from 'sqlite3-web'; const sqlite3 = await sqlite3InitModule();
import { sqlite3InitModule } from 'sqlite3-web';
sqlite3InitModule is the default export, not a named export. Must be called as a function returning a promise.

Shows initializing the WebAssembly module, creating an in-memory database, executing a query, and closing the db.

import sqlite3InitModule from 'sqlite3-web'; async function main() { const sqlite3 = await sqlite3InitModule(); const db = new sqlite3.oo1.DB(':memory:'); const rows = db.exec('SELECT 1 AS result;'); console.log(rows[0].result); // 1 db.close(); } main().catch(console.error);
Debug
Known issues
gotchasqlite3InitModule must be awaited; it returns a promise.
fix
Use `const sqlite3 = await sqlite3InitModule();`
affects: >=0.0.0
gotchaPackage only works in web browsers (WASM). Not compatible with Node.js or React Native.
fix
Use a different SQLite library for non-web environments, like sql.js for Node.
affects: >=0.0.0
gotchaDefault export is the init function, not the Sqlite3 class. Named export Sqlite3 exists but may be undefined before init.
fix
Always use `import sqlite3InitModule from 'sqlite3-web';` and then call it.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: sqlite3InitModule is not a function
Using a named import instead of default import.
fix
Change to `import sqlite3InitModule from 'sqlite3-web';`
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'DB')
Trying to access sqlite3.oo1 before the module is initialized.
fix
Await the promise returned by sqlite3InitModule().
Error: This package is not supported in this environment
Running outside a web browser (e.g., Node.js).
fix
Use a different SQLite implementation for non-browser environments.
Upgrade
Version history
0.2.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
10
Meta
2
Amazon
1
OpenAI (training)
1
Resources
sqlite3-web — npm install sqlite3-web · libregistry