Registry / storage / sqlite-http

sqlite-http

JSON →
library0.1.1jsnpmunverified

SQLite extension for making HTTP requests, distributed as an NPM package for Node.js developers. Current stable version: 0.1.1 (platform-specific precompiled binaries for darwin-x64, win32-x64, linux-x64). Release cadence: irregular, maintained by asg017. Key differentiator: allows SQL queries to fetch URLs directly, enabling in-database API integration without external HTTP libraries. Requires a SQLite client like better-sqlite3 or node-sqlite3 to load the extension.

npm install sqlite-http
INSTALL
IMPORT
SIG · SQLITE-HTTP
S
sqlite-http
storagejavascriptv0.1.1
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.

getLoadablePath
import * as sqlite_http from 'sqlite-http'; const path = sqlite_http.getLoadablePath();
const sqlite_http = require('sqlite-http'); const path = sqlite_http.getLoadablePath();
The package is ESM-only; dynamic import is also possible. getLoadablePath() returns the native extension file path.
default
import * as sqlite_http from 'sqlite-http';
import sqlite_http from 'sqlite-http';
No default export exported; use namespace import. Many users mistakenly try default import.
type definitions
import type { GetLoadablePath } from 'sqlite-http';
import { getLoadablePath } from 'sqlite-http';
The package does not ship TypeScript type definitions; if needed, declare module manually.

Load the sqlite-http extension in better-sqlite3, then use http_get() to fetch content from a URL and store it in a table.

import Database from 'better-sqlite3'; import * as sqlite_http from 'sqlite-http'; const db = new Database(':memory:'); db.loadExtension(sqlite_http.getLoadablePath()); // Make a GET request db.exec("CREATE TABLE resp AS SELECT * FROM http_get('https://httpbin.org/get')"); const rows = db.prepare('SELECT * FROM resp').all(); console.log(rows);
Debug
Known issues
gotchaPlatform-specific precompiled binaries only for darwin-x64, win32-x64, linux-x64. Other platforms will throw an error.
fix
Check process.platform and process.arch; use a compatible build or run on a supported platform.
affects: >=0.1.0
gotchagetLoadablePath() may throw an Error if no supported platform binary is found. Always wrap in try-catch or validate platform.
fix
Ensure installation succeeded and platform matches; catch error and handle gracefully.
affects: >=0.1.0
gotchaExtension functions like http_get() require SQLite client to have extension loading enabled (db.loadExtension). Missing call leads to 'not authorized' error.
fix
Always call db.loadExtension(sqlite_http.getLoadablePath()) before using any http_* SQL functions.
affects: >=0.1.0
gotchaThe package does not include TypeScript type definitions. Using with TypeScript requires manual ambient declaration.
fix
Add a .d.ts file: declare module 'sqlite-http' { export function getLoadablePath(): string; }
affects: >=0.1.0
Errors
Common errors & fixes
Error: The module './node_modules/sqlite-http/...' is not a valid platform for this Node.js binary
Installed platform-specific binary does not match host OS/architecture.
fix
Ensure you are on a supported platform (darwin-x64, win32-x64, linux-x64). Reinstall with --force or try rebuilding.
TypeError: sqlite_http.getLoadablePath is not a function
Incorrect import: used default import instead of namespace import.
fix
Use import * as sqlite_http from 'sqlite-http';
Error: not authorized to load extension
SQLite client does not allow extension loading (e.g. better-sqlite3 default config).
fix
Enable extension loading in client options: new Database(':memory:', { nativeBinding: ... }) or upgrade client.
Cannot find module 'sqlite-http' or its corresponding type declarations.
Missing npm install or incorrect import path. TypeScript users may need to declare module.
fix
Run npm install sqlite-http. For TypeScript, add a .d.ts file with module declaration.
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies
better-sqlite3optionalRequired to load the SQLite extension and execute SQL queries with http_* functions.
node-sqlite3optionalAlternative SQLite client; extension loading works similarly.
Agent activity
16 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
sqlite-http — npm install sqlite-http · libregistry