Registry / database / happn-db-provider-sqlite

happn-db-provider-sqlite

JSON →
library1.0.10jsnpmunverified

SQLite data provider for the happn database system, version 1.0.10. This package acts as a storage backend using SQLite for happn, a lightweight data layer. It focuses on providing a simple, file-based database solution with low overhead. Updates are infrequent. Compared to other providers, SQLite is ideal for embedded or single-node deployments.

npm install happn-db-provider-sqlite
INSTALL
IMPORT
SIG · HAPPN-DB-PROVIDER-
H
happn-db-provider-sqlite
databasejavascriptv1.0.10
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.

default
import Provider from 'happn-db-provider-sqlite'
import { Provider } from 'happn-db-provider-sqlite'
Default export; named import will fail.
default with require
const Provider = require('happn-db-provider-sqlite').default
const Provider = require('happn-db-provider-sqlite')
CommonJS users must use .default because the package uses ESM.
HappnClient
import { HappnClient } from 'happn'
import HappnClient from 'happn-db-provider-sqlite'
HappnClient comes from the core 'happn' package, not from this provider.

Initialize a SQLite provider and a happn client to perform basic CRUD operations.

import Provider from 'happn-db-provider-sqlite'; import { HappnClient } from 'happn'; const provider = new Provider({ filename: './data.sqlite', tableName: 'test' }); const client = new HappnClient({ provider: provider }); await client.set('key1', { hello: 'world' }); const result = await client.get('key1'); console.log(result); // { hello: 'world' } await client.delete('key1'); await client.disconnect();
Debug
Known issues
gotchaRequires the `happn` core package as a peer dependency. If not installed, you'll get a missing module error.
fix
Run `npm install happn` alongside this package.
affects: >=1.0.0
breakingv1.0.0 changed the export from named to default. `import { SQLiteProvider }` no longer works.
fix
Use `import Provider from 'happn-db-provider-sqlite'`.
affects: >=1.0.0
deprecatedOption `autoCreate` is deprecated; tables are always created automatically if they don't exist.
fix
Remove the `autoCreate` option from the constructor.
affects: >=1.0.5
gotchaConcurrent writes to the same SQLite file can cause `SQLITE_BUSY` errors. This provider is not designed for high-concurrency multi-process access.
fix
Use a different provider (e.g., PostgreSQL) for concurrent scenarios, or configure SQLite WAL mode manually.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'happn'
Missing peer dependency `happn`.
fix
Install the core package: `npm install happn`
TypeError: Provider is not a constructor
Using named import instead of default import.
fix
Use `import Provider from 'happn-db-provider-sqlite'` (not `{ Provider }`)
SqliteError: no such table: test
The provider's tableName option does not match the existing table.
fix
Ensure the `tableName` option matches the table in the SQLite file, or allow auto-creation.
Upgrade
Version history
1.0.10latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
12
Resources
happn-db-provider-sqlite — npm install happn-db-provider-sqlite · libregistry