Registry / database / bunny-sqlite

bunny-sqlite

JSON →
library0.0.9jsnpmunverified

bunny-sqlite (v0.0.9) is a lightweight SQLite client for Edge Scripting on the Bunny.net CDN. It provides a simple API to execute SQL queries, manage transactions, and handle BLOBs within the bunny-launcher environment. Designed specifically for Bunny's edge computing platform, it differs from general SQLite libraries by targeting Edge Scripting's constraints (limited memory, V8-based runtime). Currently in early development (pre-1.0), with frequent releases as a fast-moving beta. Ships with TypeScript definitions.

npm install bunny-sqlite
INSTALL
IMPORT
SIG · BUNNY-SQLITE
B
bunny-sqlite
databasejavascriptv0.0.9
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.

createConnection
import { createConnection } from 'bunny-sqlite'
const createConnection = require('bunny-sqlite')
ESM-only; require() will fail.
Connection
import type { Connection } from 'bunny-sqlite'
import { Connection } from 'bunny-sqlite'
Connection is a type; use type import in TypeScript to avoid runtime errors.
default
import bunnySqlite from 'bunny-sqlite'
import { bunnySqlite } from 'bunny-sqlite'
Package exports a default object containing factory functions like createConnection.

Creates an in-memory SQLite database, creates a table, inserts a row, queries it, and closes the connection.

import { createConnection } from 'bunny-sqlite'; async function main() { const db = createConnection(':memory:'); await db.execute('CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT)'); await db.execute('INSERT INTO users (name) VALUES (?)', ['Alice']); const rows = await db.query('SELECT * FROM users'); console.log(rows); await db.close(); } main().catch(console.error);
Debug
Known issues
breakingAPI is unstable and may change without major version bump before v1.0.0.
fix
Pin exact version and test upgrades; watch changelog.
affects: >=0.0.1 <1.0.0
deprecatedThe `execute` method's second parameter for parameters may be deprecated in favor of a newer syntax.
fix
Use `db.execute('QUERY', [params])` or check docs for updated API.
affects: >=0.0.5
gotchaOnly works inside Bunny.net Edge Scripting runtime; not compatible with standard Node.js or browser environments.
fix
Use only in Bunny.net edge functions; for local testing, use a mock or alternative.
affects: >=0.0.1
gotchaPackage uses `:memory:` for in-memory databases; persistent storage requires a valid file path on Bunny's storage.
fix
For persistence, pass a path like `/db.sqlite` (inside Bunny's writable storage).
affects: >=0.0.1
Errors
Common errors & fixes
Error: Entity: not found
Attempting to use bunny-sqlite outside Bunny.net Edge Scripting environment.
fix
Ensure code runs in a Bunny.net edge function or use a compatible mock.
TypeError: createConnection is not a function
Incorrect import; possibly using CommonJS require() or importing namespace incorrectly.
fix
Use ESM import: `import { createConnection } from 'bunny-sqlite'`.
Upgrade
Version history
0.0.9latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
10
OpenAI (training)
1
Resources
bunny-sqlite — npm install bunny-sqlite · libregistry