stable

mysql

MySQL / MariaDB adapter for noy-db — encrypted-envelope KV with a JSON column, for MySQL 8+ / MariaDB, with atomic CAS.

@noy-db/to-mysql · pnpm add @noy-db/to-mysql Encrypted-envelope KV with a JSON column.

Shaperecord
Atomic CAS✓
Localityremote
Speedmedium
Persistencedurable

What it does

Stores each record's ciphertext envelope in a JSON column, for MySQL 8+ or MariaDB. Works with any duck-typed mysql2-style pool/connection.

Notes

  • casAtomic: true via UPDATE … WHERE v = ? plus a row-count check.
  • Record shape, one row per record.
  • Factory: toMysql(options: MysqlStoreOptions).

Store-locator descriptor

See store-locator descriptors for the general model. kind: 'mysql', class: 'cloud'. address is { database?, table? }: table maps to tableName; database is identity-only, not consumed by the factory — the connection already carries it. options is { autoMigrate? }. binding.client is required — this store has no client library of its own; resolve() without it throws.

import { mysqlStoreDescriptor, registerMysqlStore } from '@noy-db/to-mysql'

const descriptor = mysqlStoreDescriptor({ database: 'app', table: 'noydb_envelopes' })

See also