kysely-wasm provides multiple Kysely dialects for running SQLite in WebAssembly environments. Version 1.2.1 requires peer dependency kysely >=0.26. It offers six dialects: SqlJsDialect (for sql.js, easy but no bigint), OfficialWasmDialect (for official SQLite Wasm build, supports OPFS in WebWorker), NodeWasmDialect (for node-sqlite3-wasm, native filesystem, no recompile), CrsqliteDialect (for vlcn.io/wasm, CRDT with IndexedDB), EmptyDialect (SQL generation only), and deprecated WaSqliteDialect (replaced by worker dialect). No bundled Wasm; users install their own.
npm install kysely-wasmNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to set up SqlJsDialect with sql.js and Kysely, execute a query, and clean up.
Replace WaSqliteDialect with the worker dialect from https://github.com/subframe7536/kysely-sqlite-tools/tree/master/dialect-wasqlite-worker
Use OfficialWasmDialect or NodeWasmDialect if BigInt support is required.
Ensure your server sets Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Embedder-Policy: require-corp, and use the dialect inside a WebWorker.
Install the appropriate Wasm package (e.g., sql.js, @sqlite.org/sqlite-wasm) and pass it when creating the dialect.
Install with: pnpm add kysely-wasm (or npm/yarn). Ensure import is correct: import { SqlJsDialect } from 'kysely-wasm'.Ensure you have initialized sql.js correctly: const SQL = await initSqlJs(); const database = new SQL.Database();
Import the dialect class: import { SqlJsDialect } from 'kysely-wasm' and instantiate with new SqlJsDialect({...}).