Repository navigation
Releases
v0.2.3
@cldmv/sqlite-wasm v0.2.3 Changelog
Release Date: November 2026
Release Type: Patch
Branch: release/0.2.3
Overview
CI now cancels superseded runs on next and hotfixes, so a burst of pushes no longer leaves every older run going. No runtime code changed: the published package is the same as v0.2.2 apart from the version number.
🔧 CI & tooling
Cancel superseded CI runs on next and hotfixes (#22)
ci.yml now carries the concurrency block from CLDMV/.github v4.46.0. Only the release base branch gets a unique group per run and is never cancelled. Everything else, including feature branches and PRs, next, hotfixes and the release PRs from them, uses a per-ref group with cancel-in-progress, so the newest commit's run replaces the older ones. Before this, runs on next and hotfixes were never cancelled and could hold a large share of the org's hosted runner slots.
📚 Documentation
- NEW: docs/changelog/v0/v0.2.3.md — this changelog.
🔧 Dependencies
- No dependency updates
Upgrade notes
- No API changes and no runtime code changes. Drop-in for v0.2.2.
fixes #19
| Metric | Coverage |
|---|---|
| Statements | 100.0% |
| Branches | 100.0% |
| Functions | 100.0% |
| Lines | 100.0% |
Avg: 100.0% · 15a4363 · Node lts/*
👥 Contributors
v0.2.2
@cldmv/sqlite-wasm v0.2.2 Changelog
Release Date: November 2026
Release Type: Patch
Branch: release/0.2.2
Overview
CI now builds and tests on macOS, on Apple Silicon and Intel, as well as on Linux. No runtime code changed: the published package is the same as v0.2.1 apart from the version number.
🔧 CI & tooling
Build and test on macOS (#18)
The wasm build downloads per-platform wasi-sdk and binaryen and uses the host make and cc, so a Linux-only check can't tell whether it still works on a Mac. ci.yml now sets extra_build_os to ["macos-latest", "macos-15-intel"], which adds a build-and-test leg on Apple Silicon and one on Intel through the shared workflow from CLDMV/.github v4.46.0.
📚 Documentation
- NEW: docs/changelog/v0/v0.2.2.md — this changelog.
🔧 Dependencies
- No dependency updates
Upgrade notes
- No API changes and no runtime code changes. Drop-in for v0.2.1.
fixes #16
| Metric | Coverage |
|---|---|
| Statements | 100.0% |
| Branches | 100.0% |
| Functions | 100.0% |
| Lines | 100.0% |
Avg: 100.0% · 88618d8 · Node lts/*
👥 Contributors
v0.2.1
@cldmv/sqlite-wasm v0.2.1 Changelog
Release Date: November 2026
Release Type: Patch
Branch: release/0.2.1
Overview
dist/ is now one file per source module, in the same layout as src/, instead of four bundles that shared code through hashed chunk-*.mjs files. Every module still exists once, so instanceof keeps working across @cldmv/sqlite-wasm, /host, /worker and /drizzle. The public API, the import names and the wasm module are unchanged.
🐛 Bug Fixes
dist/ mirrors src/ instead of hashed chunks (#14)
v0.1.0 and v0.2.0 built the four entry points with one tsup bundle and code splitting, which put the shared code into files named chunk-<hash>.mjs. Nothing in them said what they held, and the hashes changed on every build. The build now compiles each src/**/*.mts to dist/**/*.mjs at the same path with tsc, then minifies each file in place with esbuild (keepNames, source maps back to src/). Nothing is bundled: the entries share modules through plain relative imports, so there is still one copy of each class.
./hostand./workernow resolve todist/worker/host.mjsanddist/worker/client.mjs. The package's import names are the same.- The Node and browser loaders find
sqlite3.wasmat../sqlite3.wasmfromdist/core/, still the samedist/sqlite3.wasm. Bundlers that copy the wasm from thenew URL(..., import.meta.url)pattern keep doing so. - tsup is no longer a dev dependency;
scripts/build-js.mjsreplacestsup.config.mjs. - A test checks that
dist/has exactly one.mjsper source module and no generated chunks.
🔧 CI & tooling
- The bundle-size check measured
dist/**.mjs, which only matches files at the top ofdist/. It now usesdist/**/*.mjs,dist/**/*.cjsanddist/**/*.wasm.
📚 Documentation
docs/DESIGN.mdand the README describe the per-module build.- NEW: docs/changelog/v0/v0.2.1.md — this changelog.
🔧 Dependencies
- Removed
tsup(dev). Addedesbuild(dev), used directly.
Upgrade notes
- No API changes. Drop-in for v0.2.0.
- Code that imported files inside
dist/by path (not through the package's exports) needs the new paths; thechunk-*.mjsfiles anddist/host.mjs/dist/worker.mjsno longer exist.
| Metric | Coverage |
|---|---|
| Statements | 100.0% |
| Branches | 100.0% |
| Functions | 100.0% |
| Lines | 100.0% |
Avg: 100.0% · 218ad8e · Node lts/*
👥 Contributors
v0.2.0
@cldmv/sqlite-wasm v0.2.0 Changelog
Release Date: November 2026
Release Type: Minor
Branch: release/0.2.0
Overview
Adds bytes(), a Drizzle blob column that holds a plain Uint8Array, so browser apps can store binary data through Drizzle without a Buffer polyfill. The release also adds a design document and fuller npm keywords. Nothing else changed at runtime, and the wasm module is the same build as v0.1.0.
✨ Features
bytes() blob column for Drizzle (#8)
@cldmv/sqlite-wasm/drizzle now exports bytes(), a blob column whose value is a Uint8Array:
import { bytes } from "@cldmv/sqlite-wasm/drizzle";
import { integer, sqliteTable } from "drizzle-orm/sqlite-core";
export const files = sqliteTable("files", {
id: integer("id").primaryKey(),
data: bytes("data").notNull()
});Drizzle's own blob() modes call Node's Buffer, which browsers don't have, so using them in a page or worker needs a polyfill. bytes() never touches Buffer. Blobs already come back from the database, and through the worker client, as Uint8Array, so it passes values straight through. It stores a blob, so drizzle-kit generates the same column as blob("data"). It is covered in Node, CommonJS and dist/, through the worker client, and in Chromium with no Buffer defined.
📚 Documentation
- NEW: docs/DESIGN.md (#9): how the library is built and why, covering the toolchain, the source-archive build, the C ↔ JS VFS contract, the storage drivers, WAL without shared memory, locking, the worker client, multi-tab sharing and the Drizzle driver.
- README: a section on
bytes(), and theBuffercaveat now points to it. - NEW: docs/changelog/v0/v0.2.0.md — this changelog.
🔧 CI & tooling
- npm keywords (#11): expanded from five to 26 so the package turns up for searches such as sqlite3, OPFS, local-first, full-text search and Drizzle ORM.
🔧 Dependencies
No dependency updates
Upgrade notes
- No breaking changes. Drop-in for v0.1.0.
- Apps that installed a
Bufferpolyfill only for Drizzle blob columns can switch those columns tobytes()and drop the polyfill. The stored data is the sameblob, so no migration is needed.
| Metric | Coverage |
|---|---|
| Statements | 100.0% |
| Branches | 100.0% |
| Functions | 100.0% |
| Lines | 100.0% |
Avg: 100.0% · 5d1134b · Node lts/*
👥 Contributors
v0.1.0
@cldmv/sqlite-wasm v0.1.0 Changelog
Release Date: November 2026
Release Type: Minor (first release)
Branch: release/0.1.0
Overview
First release of @cldmv/sqlite-wasm: SQLite 3.54.1 compiled to WebAssembly, with one build and one API for Node.js and browsers. Databases are real files in Node, OPFS in a browser worker, or memory anywhere, and the files are standard SQLite files that native SQLite and node:sqlite open as usual.
The wasm is built from SQLite's own source archive with wasi-sdk and binaryen. There is no Emscripten runtime and no fork of another wasm SQLite project. CI builds it from a pinned SQLite version and hash, and nothing binary is committed.
✨ Features
Synchronous database API on one shared wasm instance (#2)
sqlite.open(path, options) returns a database with prepared statements, run / get / all / iterate, transactions (nested ones become savepoints), user-defined functions, aggregates, window functions and collations, plus backup(), serialize(), attach() and checkpoint(). Every connection in a process shares one module instance, which is what lets ATTACH and backup() work between them. Every SQLite failure is a sqlite.error carrying the result code name (SQLITE_CONSTRAINT_PRIMARYKEY) and the extended code number.
Storage drivers: fs, opfs and memory (#2)
fs(Node) writes real files through synchronousfscalls, withfsyncon the file and on its folder after create and delete.opfs(dedicated browser workers) uses OPFS sync access handles, opened before SQLite needs them, so no COOP/COEP headers are needed.memoryworks anywhere. Each file name keeps its data for the life of the process.auto(the default) picksfsin Node andopfsin a dedicated worker.
WAL is the default journal mode, run in exclusive locking mode so the WAL index lives in heap memory. A clean close() checkpoints the WAL and removes the -wal file. truncate and delete rollback journals are available too.
Locking between processes and tabs (#2)
In Node, opening a database takes an owner lock outside the file, and the lock option picks where it lives: beside (a <db>.lock/ folder, the default), temp (a private per-user folder under os.tmpdir()), a folder you name, or db (a row inside the database). A lock whose process is gone is taken over. In browsers, the lock is a Web Lock per database.
Browser main thread: worker host and client (#2)
@cldmv/sqlite-wasm/host runs the database in a worker with host.listen(self), and @cldmv/sqlite-wasm/worker gives the main thread an async client with the same API, including nested transactions, backup() and serialize(). A setup(db) hook on the host runs on every open.
Multi-tab sharing (#2)
With share: true, several tabs of one origin use one OPFS database. One tab's worker owns the database and the others send their requests to it over a BroadcastChannel. Ownership moves through a Web Lock when that tab closes or its worker ends, with reads retried against the new owner, and writes whose outcome is unknown failing with SQLITE_BUSY rather than running twice. db.info.leader and db.info.watch() show which tab owns it.
Drizzle ORM driver (#2)
@cldmv/sqlite-wasm/drizzle exports drizzle() and migrate() for the synchronous database (Node or inside a worker) and for the async worker client on the main thread. drizzle-orm ^0.45.0 is an optional peer dependency.
What is compiled in (#2)
FTS3/4/5, R*Tree and Geopoly, JSON, dbstat, math and percentile functions, column metadata, STAT4, and UPDATE/DELETE ... ORDER BY ... LIMIT (generated into the parser from the source archive, so Drizzle's .orderBy() and .limit() work on updates and deletes). Foreign keys are on and double-quoted strings are identifiers only. The README's "What is compiled in" section has the full list, including what is left out.
🔧 CI & tooling
- Package layout and v4 CI (#1): tsup build into
dist/with a CommonJS entry that re-exports the ESM one,@cldmv/vitest-runnertests, eslint and prettier, and the CLDMV v4 workflow set. - The wasm build in CI (#2): pinned and hash-checked downloads of SQLite's source archive, wasi-sdk and binaryen, with retries and a cache. The browser tests run headless Chromium as their own CI job, and
npm run sqlite:bumpmoves the SQLite pin. - Generated types (#4):
types/is built when the package is built or packed instead of being committed, and each published declaration's header names its own file.
🔧 Dependencies
drizzle-orm^0.45.0: optional peer dependency, needed only for@cldmv/sqlite-wasm/drizzle.- No runtime dependencies.
Upgrade notes
- First release, nothing to upgrade from.
- Node.js
>=20.19.0at runtime. The CommonJS entry needsrequire(esm), so^20.19.0or>=22.13.0. - Browsers need a dedicated worker with OPFS sync access handles for persistent storage. Multi-tab sharing also needs Web Locks and
BroadcastChannel.
| Metric | Coverage |
|---|---|
| Statements | 100.0% |
| Branches | 100.0% |
| Functions | 100.0% |
| Lines | 100.0% |
Avg: 100.0% · c0f05b9 · Node lts/*