Registry / database / jeep-sqlite

jeep-sqlite

JSON →
library2.8.0jsnpmunverified

A Stencil-based web component that provides SQLite database capabilities in the browser, backed by sql.js for SQL execution and localforage for IndexedDB storage. Version 2.8.0, updated to Stencil 4.20.0 and sql.js 1.11.0. Supports multiple databases stored in a single IndexedDB store. Designed for use in PWA and Capacitor-Community-SQLite web implementation. Integrates with frameworks like Vue, React, Ionic/Angular, SolidJS. Offers APIs similar to @capacitor-community-sqlite for testing compatibility.

npm install jeep-sqlite
INSTALL
IMPORT
SIG · JEEP-SQLITE
J
jeep-sqlite
databasejavascriptv2.8.0
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.

JeepSqlite
import { JeepSqlite } from 'jeep-sqlite';
const JeepSqlite = require('jeep-sqlite');
Component is a Stencil web component; import as module in JS/TS. No named exports of classes.
jeep-sqlite (custom element)
<jeep-sqlite></jeep-sqlite>
Use as a custom element in HTML. Not a React/Angular component directly; wrap accordingly.
CustomEvent details
document.querySelector('jeep-sqlite').addEventListener('jeepSqliteSaveDatabaseToDisk', (e) => console.log(e.detail));
use of onEvent attribute
Events are dispatched on the element; use addEventListener.

Shows creating a connection, opening a database, executing SQL, and querying data.

// Install: npm install jeep-sqlite // Ensure sql-wasm.wasm is in your public/assets folder (copy from node_modules/sql.js/dist/sql-wasm.wasm) import 'jeep-sqlite'; const db = document.createElement('jeep-sqlite'); document.body.appendChild(db); // Wait for component to load (define custom element) customElements.whenDefined('jeep-sqlite').then(() => { // Execute SQL db.createConnection('testDB', false, 'no-encryption', 1).then(() => { db.open('testDB').then(() => { db.execute('CREATE TABLE IF NOT EXISTS test (id INTEGER PRIMARY KEY, name TEXT)').then(res => { console.log('Table created', res); db.execute("INSERT INTO test VALUES (1, 'Alice')").then(() => { db.query('SELECT * FROM test').then(result => { console.log('Query result', result); }); }); }); }); }); });
Debug
Known issues
gotchaMust copy sql-wasm.wasm from node_modules/sql.js/dist/ to your app's public/assets directory. Missing file causes 'Error: Uncaught (in promise): TypeError: x is not a function'
fix
Copy the WASM file to your assets. For Vite: copy via vite-plugin-static-copy or manual.
affects: >=2.0.0
breakingsql.js@1.9.0+ causes 'Error: out of memory'. Version 2.5.6 reverted to sql.js@1.8.0.
fix
Pin sql.js to 1.8.0 in package.json overrides.
affects: 2.5.0 - 2.5.5
breakingStencil component uses extra.enableImportInjection=true for Vite bundler compatibility (PR #41).
fix
Ensure Stencil configuration includes that flag if building with Vite.
affects: 2.8.0
deprecatedUsing default import on the component (import JeppSqlite from 'jeep-sqlite') may not work; use side-effect import.
fix
Use import 'jeep-sqlite' for side effects only.
affects: all
Errors
Common errors & fixes
Error: Uncaught (in promise): TypeError: x is not a function TypeError: x is not a function at x (jeep-sqlite.entry.js:2648:80)
Missing sql-wasm.wasm file in assets
fix
Copy node_modules/sql.js/dist/sql-wasm.wasm to your app's public/assets (or equivalent).
Error: out of memory
sql.js version 1.9.0 or higher causing memory issues
fix
Downgrade sql.js to 1.8.0 in your package.json.
Uncaught SyntaxError: Failed to resolve module specifier 'jeep-sqlite'
Missing import or bundler not configured for web components
fix
Ensure you have imported the package with import 'jeep-sqlite'; and that your bundler (e.g., Vite) handles it.
Upgrade
Version history
2.8.0latest on npm
Audit
Dependencies
sql.jsrequiredProvides SQLite query engine (WASM-based)
localforagerequiredStores databases in IndexedDB
browser-fs-accessoptionalFile System Access API for local disk read/write
Agent activity
6 hits · last 30 days
node
6
Resources
jeep-sqlite — npm install jeep-sqlite · libregistry