sql.js-httpvfs (v0.8.12) is a read-only HTTP-Range-request based virtual file system for SQLite in the browser. It wraps sql.js to allow querying SQLite databases hosted on static file hosts without full download. Key differentiators: enables client-side SQL queries on large databases with lazy loading via HTTP range requests, includes a DOM virtual table proof-of-concept, and supports splitting databases into chunks for CDN caching. Works well with proper indexing and page size tuning. Low release cadence; last update was 2024.
npm install sql.js-httpvfsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize a worker with an inline config pointing to a SQLite file, then run a parameterized SELECT query.
Use new URL() with import.meta.url or configure bundler to include sql.js-httpvfs/dist/* files.
Run PRAGMA page_size=1024; VACUUM; on your SQLite database before hosting.
Set maxBytesToRead to at least 10MB or Infinity for full database access.
Update config to use { from: 'inline', config: { ... } } instead of passing url directly.Always pass wasmUrl.toString() as third argument.
Use file-loader or copy-webpack-plugin to manually copy dist files and reference them with a string URL.
Use `import { createDbWorker } from 'sql.js-httpvfs'` (ESM) or ensure bundler is configured for ES modules.Await the createDbWorker promise: `const worker = await createDbWorker(...)`.
Configure server to serve .wasm files with MIME type application/wasm or set Content-Type header.
Add CORS headers to the server hosting the SQLite file, or serve it from the same origin.