You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Brings the driver onto CosmoKv's audited 3.2 release line and exposes
the v2.2 / v3.0 / v3.1 / v3.2 features the previous pin couldn't reach.
CosmoSQLClient.CosmoKv
- csproj: CosmoKv 2.1.9 → 3.2.0.
- CosmoKvConfiguration: new EncryptionKey (byte[]?) opens or creates
the store as an AES-256-GCM encrypted database; length validated by
CosmoKv's own DbOptions check (32 bytes). New AllowPlaintextBackup
(bool, default false) is the explicit opt-in before a plaintext
BackupAsync is allowed against an encrypted DB. Connection-string
parser accepts EncryptionKey=<base64> and AllowPlaintextBackup=true;
programmatic construction is preferred for key material — connection
strings are commonly logged.
- CosmoKvConnection.OpenAsync now builds the full DbOptions (was
DbOptions.Default(path)), threading EncryptionKey +
AllowPlaintextBackup through.
- New BackupAsync(Stream, byte[]? backupKey, CT) overload — non-null
key produces an AEAD-encrypted COSMOBAK stream; null requires
AllowPlaintextBackup on encrypted sources.
- New RunValueLogGcAsync(CT) wrapper exposing vlog space reclaim
without reaching for RawDb.
- Storage/Catalog.cs: documented Item.ReadValueAsync lifetime at the
two HydrateAsync scan loops — CosmoKv v3.1 made the iterator-only
validity an explicit invariant; the call sites are already safe,
but a future refactor that caches Item past the loop body would
break.
CosmoSQLClient.CosmoKv.Cli
- .backup FILENAME writes a COSMOBAK snapshot (refuses to overwrite).
- .vacuum runs RunValueLogGcAsync and reports files reclaimed.
- .help + README updated. Opening an encrypted store from the shell
works today via the connection-string EncryptionKey=<base64> form.
Tests
- +3 connection tests: COSMOBAK magic on BackupAsync, no-throw zero
return on RunValueLogGcAsync against an empty store, base64-decoded
EncryptionKey + AllowPlaintextBackup round-trip through Parse.
- 276/276 driver pass; 6/6 Http and 10/10 Pipes pass against the
transitive bump.
Migration note: encrypted databases written by the previous driver
(CosmoKv 2.x) are NOT readable here. CosmoKv v3.0 changed the WAL/vlog
AEAD AAD scheme from fileId to (fileId, frameOffset) to defeat
intra-file frame-relocation attacks. To migrate, take a backup with
the previous driver, then restore into a fresh v3.x store. Plaintext
databases upgrade transparently.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Statement splitting is lexical only — it understands single-quoted strings but not block comments or T-SQL `GO`. A trailing `;` ends the current statement.
123
125
- No `readline`-style history or autocomplete; if you want those, wrap the CLI with `rlwrap`.
124
-
-`.dump` rewrites every row as a fully-qualified `INSERT`. For tables with millions of rows, prefer `BackupAsync` (in code) to a COSMOBAK snapshot.
126
+
-`.dump` rewrites every row as a fully-qualified `INSERT`. For tables with millions of rows, prefer `.backup FILENAME` — it writes a COSMOBAK snapshot directly without the parse/encode round-trip.
127
+
-`.backup` only writes plaintext snapshots. To re-encrypt with a different key, use `BackupAsync(stream, backupKey)` in code.
128
+
- Opening an encrypted store from the shell requires a connection string with `EncryptionKey=<base64>` (32-byte AES-256 key, base64-encoded). Bare-path `.open ./mydb` opens unencrypted.
0 commit comments