Registry / database / lupdo-sqlite

lupdo-sqlite

JSON →
library2.0.0jsnpmunverified

SQLite driver for the Lupdo database abstraction layer (v2.0.0). Built on better-sqlite3, offering synchronous-like performance with connection pooling, WAL mode support, automatic WAL checkpointing, safe integer handling, and TypeScript types. Requires Node >=18 and lupdo ^4.0.1. Minimal configuration with pool size and driver-specific options like journal mode, synchronous pragma, and max WAL file size. Key differentiator: converts BigInt to Number internally for compatibility, returns non-integer numbers as strings to preserve precision. Does not support kill query or array parameter binding.

npm install lupdo-sqlite
INSTALL
IMPORT
SIG · LUPDO-SQLITE
L
lupdo-sqlite
databasejavascriptv2.0.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.

createSqlitePdo
import { createSqlitePdo } from 'lupdo-sqlite'
import createSqlitePdo from 'lupdo-sqlite'
Named export, not default. Also works with CommonJS require.
createSqlitePdo (CommonJS)
const { createSqlitePdo } = require('lupdo-sqlite')
const createSqlitePdo = require('lupdo-sqlite')
Destructure required to get the function; otherwise you get an object.
TypeScript types (SqlitePdoOptions)
import type { SqlitePdoOptions } from 'lupdo-sqlite'
import { SqliteDriverOptions } from 'lupdo-sqlite'
Type name is SqlitePdoOptions, not SqliteDriverOptions. The driver ships TypeScript declarations.

Creates an in-memory SQLite PDO with connection pool (min 2, max 3), runs a SELECT query, fetches all rows as array, and disconnects.

import { createSqlitePdo } from 'lupdo-sqlite'; const pdo = createSqlitePdo({ path: ':memory:' }, { min: 2, max: 3 }); async function run() { const statement = await pdo.query('SELECT 1 + 1 AS result'); const rows = statement.fetchArray().all(); console.log(rows); // [[2]] await pdo.disconnect(); } run().catch(console.error);
Debug
Known issues
gotchaNon-integer numbers are returned as strings to preserve precision. You must cast them in your application.
fix
Parse returned strings with parseFloat() or Number() as needed.
affects: >=1.0.0
gotchaLupdo-sqlite does not support array parameters. Attempting to pass an array will cause unexpected behavior or errors.
fix
Use positional or named placeholders with scalar values only.
affects: >=2.0.0
gotchaKill query is not supported. Calling kill on a PDO instance will be a no-op or throw.
fix
Avoid using kill methods; rely on query timeouts or external mechanisms.
affects: >=2.0.0
gotchaSafe integers enabled by default: BigInt from SQLite is converted to Number internally. If the integer exceeds Number.MAX_SAFE_INTEGER, precision may be lost.
fix
If you need full BigInt precision, consider disabling safe integers via driver options or handle the conversion manually.
affects: >=2.0.0
Errors
Common errors & fixes
Error: createSqlitePdo is not a function
Importing default export instead of named export.
fix
Use `import { createSqlitePdo } from 'lupdo-sqlite'` or `const { createSqlitePdo } = require('lupdo-sqlite')`.
ERR_PACKAGE_PATH_NOT_EXPORTED: Package subpath './dist/index' is not defined
Using an incorrect import path that is not exposed by the package exports map.
fix
Import from 'lupdo-sqlite' only; do not use subpaths like 'lupdo-sqlite/dist/...'.
TypeError: Cannot read properties of undefined (reading 'all')
fetchArray() returns undefined or statement not properly awaited/resolved.
fix
Ensure `const statement = await pdo.query(...)` is awaited and the promise resolves.
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
lupdorequiredPeer dependency – core database abstraction layer required at version ^4.0.1.
better-sqlite3requiredUnderlying SQLite library used for database operations.
Agent activity
6 hits · last 30 days
node
4
Resources
lupdo-sqlite — npm install lupdo-sqlite · libregistry