{"library":"sqlite-wasm-http","title":"SQLite WASM HTTP VFS Backend","type":"library","description":"sqlite-wasm-http provides an HTTP Virtual File System (VFS) backend for the official SQLite WASM distribution, enabling direct querying of remote SQLite databases over HTTP. It is designed to be a robust solution for browser and Node.js environments (Node.js 18+ required for full functionality) and supports features like multiple concurrent connections with shared caching (requiring `SharedArrayBuffer` and COOP/COEP headers) or a simplified fall-back without it. The library is currently at v1.2.0 and appears to have a semi-regular release cadence, with updates often tied to new official SQLite WASM builds or bug fixes. A key differentiator is its focus on the official SQLite WASM distribution, aiming to be an industry reference, and its support for shared cache across workers, offering performance benefits over similar solutions.","language":"javascript","status":"active","last_verified":"Wed Apr 22","install":{"commands":["npm install sqlite-wasm-http"],"cli":null},"imports":["import { createSQLiteThread } from 'sqlite-wasm-http';","import { createHttpBackend } from 'sqlite-wasm-http';","import type { SQLite } from 'sqlite-wasm-http';\n// ... then use SQLite.SQLValue"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/mmomtchev/sqlite-wasm-http","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/sqlite-wasm-http","openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import { createSQLiteThread, createHttpBackend } from 'sqlite-wasm-http';\n\nasync function runRemoteQuery() {\n  const remoteURL = 'https://velivole.b-cdn.net/maptiler-osm-2017-07-03-v3.6.1-europe.mbtiles';\n  // createHttpBackend will autodetect if you can use SharedArrayBuffer or not\n  const httpBackend = createHttpBackend({\n    maxPageSize: 4096,    // This is the current default SQLite page size\n    timeout: 10000,       // 10s\n    cacheSize: 4096       // 4 MB (corresponds to 4096 pages of 1KB each for default 1024 page_size)\n  });\n\n  // Multiple DB workers can be created, all sharing the same backend cache\n  const db = await createSQLiteThread({ httpBackend });\n\n  try {\n    const results = await db.exec({\n      sql: 'SELECT name FROM sqlite_master WHERE type=\\'table\\';'\n    });\n    console.log('Tables:', results.results[0].row);\n\n    const countResult = await db.exec({\n      sql: 'SELECT count(*) FROM tiles WHERE zoom_level = ?;',\n      bind: [1]\n    });\n    console.log('Tiles at zoom 1:', countResult.results[0].row);\n  } finally {\n    db.close();\n  }\n}\n\nrunRemoteQuery().catch(console.error);","lang":"typescript","description":"This quickstart demonstrates how to initialize the HTTP VFS backend and connect to a remote MBTiles database. It then executes a simple query to list tables and count entries at a specific zoom level, showcasing basic database interaction and proper resource cleanup.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}