Skip to content

feat(drizzle): add a bytes() blob column that needs no Buffer - #8

Merged
Shinrai merged 1 commit into
nextfrom
feat/drizzle-bytes
Nov 26, 2026
Merged

Shinrai merged 1 commit into
nextfrom
feat/drizzle-bytes

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

🚀 What's Changed

💥 Breaking Changes

No breaking changes

✨ Features

  • feat(drizzle): add a bytes() blob column that needs no Buffer (0c933c1)

🐛 Bug Fixes

No bug fixes

📦 Dependencies

No dependency updates

🔧 Other Changes

No other changes

👥 Contributors

@cldmv-bot cldmv-bot Bot added type: feature Implements new functionality — a PR or issue that adds a feature area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure type: documentation Relates to docs, README updates, guides, or inline code comments labels Nov 26, 2026
@Shinrai
Shinrai merged commit b67d1e1 into next Nov 26, 2026
33 checks passed
@cldmv-bot
cldmv-bot Bot deleted the feat/drizzle-bytes branch November 26, 2026 02:44
cldmv-bot Bot added a commit that referenced this pull request Nov 26, 2026
# `@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](#8))

`@cldmv/sqlite-wasm/drizzle` now exports `bytes()`, a blob column whose value is a `Uint8Array`:

```js
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](https://github.com/CLDMV/lib-sqlite-wasm/blob/master/docs/DESIGN.md) ([#9](#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](https://github.com/CLDMV/lib-sqlite-wasm/blob/v0.2.0/docs/changelog/v0/v0.2.0.md) — this changelog.

## 🔧 CI & tooling

- **npm keywords** ([#11](#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.



<details>
<summary>👥 Contributors</summary>

- @Shinrai

</details>

---

<!-- coverage-start -->

![coverage](https://img.shields.io/badge/coverage-100.0%25-brightgreen?style=for-the-badge&logo=vitest&logoColor=white)

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

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

<!-- coverage-end -->

<!-- co-authors -->

Co-authored-by: Shinrai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure type: documentation Relates to docs, README updates, guides, or inline code comments type: feature Implements new functionality — a PR or issue that adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant