Registry / database / sqlite-hello

sqlite-hello

JSON →
library0.1.0-alpha.79jsnpmunverified

A minimal SQLite extension package that demonstrates the sqlite-dist build and distribution system. Version 0.1.0-alpha.79 is the latest alpha release. It provides a single function `hello()` that returns a greeting string, serving primarily as a test and learning tool for building SQLite extensions with sqlite-dist. Unlike full-featured SQLite extensions (e.g., sqlean, sqlpkg), this package is intentionally minimal, focusing on illustrating the packaging and loading process. Releases are infrequent, as development is tied to sqlite-dist improvements.

npm install sqlite-hello
INSTALL
IMPORT
SIG · SQLITE-HELLO
S
sqlite-hello
databasejavascriptv0.1.0-alpha.79
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.

hello
import { hello } from 'sqlite-hello'
const hello = require('sqlite-hello')
ESM-only; CommonJS require is not supported.
sqlite-hello (default)
import sqliteHello from 'sqlite-hello'
const sqliteHello = require('sqlite-hello')
Default export is a function that returns the hello extension object.
type HelloExtension
import type { HelloExtension } from 'sqlite-hello'
Type-only import when using TypeScript.

Load the hello extension into sqlite-dist, then call the hello function.

import { hello } from 'sqlite-hello'; import { loadExtension, Database } from 'sqlite-dist'; const db = new Database(); await loadExtension(db, hello); const result = db.query('SELECT hello("world")') console.log(result); // [{ hello: 'Hello, world!' }]
Debug
Known issues
breakingsqlite-hello v0.1.0-alpha.79 requires sqlite-dist >= 0.2.0. Older versions incompatible.
fix
Update sqlite-dist to >=0.2.0.
affects: <0.1.0-alpha.79
deprecatedThe synchronous 'hello()' function is deprecated in favor of async 'helloAsync()' starting from v0.2.0.
fix
Use 'helloAsync()' for async operations.
affects: >=0.2.0
gotchaDefault export returns a module object, not the extension function directly. Use named import for clarity.
fix
Use `import { hello } from 'sqlite-hello'` instead of `import hello from 'sqlite-hello'`.
affects: *
breakingIn v0.3.0, the extension function signature changed from (db: Database) => void to (db: Database, options?: object) => void.
fix
Update extension functions to accept optional options object.
affects: >=0.3.0
gotchasqlite-hello only works with sqlite-dist. Cannot be loaded with better-sqlite3 or node-sqlite3.
fix
Use only with sqlite-dist runtime.
affects: *
Errors
Common errors & fixes
Cannot find module 'sqlite-hello'
Missing dependency in package.json or not installed.
fix
Run `npm install sqlite-hello` or add it to your package.json.
The module 'sqlite-hello' does not provide a named export 'hello'
Using an older version (pre-0.1.0) where the function was exported as default only.
fix
Update to >=0.1.0 or use `import hello from 'sqlite-hello'`.
Error: Not a valid SQLite extension
Trying to load the extension with a non-sqlite-dist runtime.
fix
Use sqlite-dist to load the extension: `await loadExtension(db, hello)`.
TypeError: hello is not a function
Default import returns the extension module object, not the function.
fix
Use named import: `import { hello } from 'sqlite-hello'`.
Upgrade
Version history
0.1.0-alpha.79latest on npm
Audit
Dependencies
sqlite-distrequiredRequired as the runtime for loading SQLite extensions built with sqlite-dist.
Agent activity
19 hits · last 30 days
node
14
Meta
2
OpenAI (training)
1
Resources
sqlite-hello — npm install sqlite-hello · libregistry