Skip to content

@xtandard/kit/storage/drizzle

@xtandard/kit/storage/drizzle — storage over a Drizzle table and database you own (Postgres, MySQL or SQLite): no DDL, no connection of its own, single-statement compare-and-swap.

Optional peer: drizzle-orm (loaded on first use; build the table with @xtandard/kit/drizzle/{pg,mysql,sqlite}).

import { … } from "@xtandard/kit/storage/drizzle";
Name Summary
createDrizzleStorage Create a Drizzle-backed DrizzleKvStorage. No DDL, no connection ownership.
Name Summary
KeyCollisionError Thrown by setItem on MySQL when the key column’s collation is PAD SPACE (utf8mb4_bin) and the key differs from a stored key only by trailing spaces ("a " vs "a"): the write is refused instead of overwriting the other key. The message carries the migration SQL to a NO PAD collation (utf8mb4_0900_bin).
Name Summary
DrizzleStorageOptions Options for createDrizzleStorage.
Name Summary
DrizzleKvStorage A compare-and-swap capable storage over a Drizzle table. For change notifications, compose it with withWatch and a change source such as pgListenNotify.
Name Documented on
DrizzleDialect @xtandard/kit/storage/drizzle/internals
DrizzleKvTable @xtandard/kit/drizzle/mysql