Skip to content

@xtandard/kit/drizzle/mysql

@xtandard/kit/drizzle/mysql — the MySQL KV table factory mysqlKvTable(name, opts) and the binVarchar (utf8mb4_bin) column helper. Schema-only; requires drizzle-orm.

import { … } from "@xtandard/kit/drizzle/mysql";
Name Summary
binVarchar A varchar(length) CHARACTER SET utf8mb4 COLLATE <collation> column: case- and accent-sensitive. length defaults to 512 (keep it within your InnoDB index-prefix limit for keys); collation defaults to utf8mb4_bin. Pass a NO PAD collation (MysqlKeyCollation) for keys that may differ only by trailing spaces.
mysqlKvTable Build a Drizzle mysqlTable for the KV storage: key varchar(keyLength) … COLLATE utf8mb4_bin PRIMARY KEY, value json NOT NULL. name is required (ADR 0005).
Name Summary
MysqlKvTableOptions Options for mysqlKvTable.
Name Summary
DrizzleKvTable A table with the fixed key/value columns the Drizzle KV storage requires.
MysqlKeyCollation A binary key collation: utf8mb4_bin (default; PAD SPACE, so "a " and "a" compare equal), or a NO PAD one for new tables: utf8mb4_0900_bin (MySQL 8.0+) or utf8mb4_nopad_bin (MariaDB).
MysqlKvColumns The self passed to a MysqlKvTableOptions.extraIndexes callback.