Skip to content

Releases

v0.2.3

Choose a tag to compare

@cldmv-bot cldmv-bot released this 28 Nov 04:54
v0.2.3
4a1d416

@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

🔧 Dependencies

  • No dependency updates

Upgrade notes

  • No API changes and no runtime code changes. Drop-in for v0.2.2.

fixes #19


coverage

Metric Coverage
Statements 100.0%
Branches 100.0%
Functions 100.0%
Lines 100.0%

Avg: 100.0% · 15a4363 · Node lts/*

👥 Contributors

v0.2.2

Choose a tag to compare

@cldmv-bot cldmv-bot released this 28 Nov 02:35
v0.2.2
284a1d3

@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

🔧 Dependencies

  • No dependency updates

Upgrade notes

  • No API changes and no runtime code changes. Drop-in for v0.2.1.

fixes #16


coverage

Metric Coverage
Statements 100.0%
Branches 100.0%
Functions 100.0%
Lines 100.0%

Avg: 100.0% · 88618d8 · Node lts/*

👥 Contributors

v0.2.1

Choose a tag to compare

@cldmv-bot cldmv-bot released this 26 Nov 04:25
v0.2.1
5cc0eb5

@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.

  • ./host and ./worker now resolve to dist/worker/host.mjs and dist/worker/client.mjs. The package's import names are the same.
  • The Node and browser loaders find sqlite3.wasm at ../sqlite3.wasm from dist/core/, still the same dist/sqlite3.wasm. Bundlers that copy the wasm from the new URL(..., import.meta.url) pattern keep doing so.
  • tsup is no longer a dev dependency; scripts/build-js.mjs replaces tsup.config.mjs.
  • A test checks that dist/ has exactly one .mjs per source module and no generated chunks.

🔧 CI & tooling

  • The bundle-size check measured dist/**.mjs, which only matches files at the top of dist/. It now uses dist/**/*.mjs, dist/**/*.cjs and dist/**/*.wasm.

📚 Documentation

🔧 Dependencies

  • Removed tsup (dev). Added esbuild (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; the chunk-*.mjs files and dist/host.mjs / dist/worker.mjs no longer exist.

coverage

Metric Coverage
Statements 100.0%
Branches 100.0%
Functions 100.0%
Lines 100.0%

Avg: 100.0% · 218ad8e · Node lts/*

👥 Contributors

v0.2.0

Choose a tag to compare

@cldmv-bot cldmv-bot released this 26 Nov 03:12
v0.2.0
ae9453d

@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 the Buffer caveat 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 Buffer polyfill only for Drizzle blob columns can switch those columns to bytes() and drop the polyfill. The stored data is the same blob, so no migration is needed.

coverage

Metric Coverage
Statements 100.0%
Branches 100.0%
Functions 100.0%
Lines 100.0%

Avg: 100.0% · 5d1134b · Node lts/*

👥 Contributors

v0.1.0

Choose a tag to compare

@cldmv-bot cldmv-bot released this 26 Nov 02:17
v0.1.0
6d54627

@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 synchronous fs calls, with fsync on 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.
  • memory works anywhere. Each file name keeps its data for the life of the process.
  • auto (the default) picks fs in Node and opfs in 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-runner tests, 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:bump moves 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.0 at runtime. The CommonJS entry needs require(esm), so ^20.19.0 or >=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.

coverage

Metric Coverage
Statements 100.0%
Branches 100.0%
Functions 100.0%
Lines 100.0%

Avg: 100.0% · c0f05b9 · Node lts/*

👥 Contributors