@voltro/database 0.79.0 → 0.79.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -39,6 +39,61 @@ _Changes staged for the next release accumulate here (rolled up from
39
39
 
40
40
  ---
41
41
 
42
+ ## [0.79.1] — 2026-09-24
43
+
44
+ ### Changed
45
+
46
+ - **A charset conversion blocked by a soft-drop snapshot names the reclaim** — `@voltro/database`
47
+
48
+ A declared `store.charset` refuses to convert a table that a foreign key ties to a table the plan does not convert. When that other table is a soft-drop snapshot (`<name>__dropped_<stamp>`), the fix line offered three remedies that do not fit one: declaring it, converting it by hand, or leaving the charset undeclared. It now names `voltro db gc-snapshots --before <date>` with the date that covers the newest blocking snapshot, says that the date also removes every older snapshot, and names `voltro db restore-snapshot` for data that is still wanted.
49
+ - **The devtools capsule morphs into a status and back** — `@voltro/devtools`
50
+
51
+ When `voltro dev` reported a status such as "Compiling…", the closed capsule swapped its chips for the status in one frame and jumped to the new width. The swap is now a morph: the incoming content fades up while the capsule glides from its old width to the new one, and a status that changes mid-glide continues from the width reached. Under `prefers-reduced-motion` the swap stays immediate.
52
+ - **The devtools console animates out the way it came in** — `@voltro/devtools`
53
+
54
+ Opening the console slid it in from its dock edge (or scaled a floating window up), but closing removed it in one frame. Closing now plays the entrance backwards: the console slides out towards its edge, or the window scales down and fades, and the capsule returns once it has gone. The console ignores input while it leaves, a page pushed aside by it reflows only after it is gone, and under `prefers-reduced-motion` it still closes at once.
55
+
56
+ ### Fixed
57
+
58
+ - **Probes are answered while a large app's modules load at boot** — `@voltro/cli`
59
+
60
+ The app port answers the health probes from the start of the boot, but the process that answers them is the one booting. Loading the app's modules runs on Node's synchronous loader, so the whole run was one turn of the event loop and a probe waited for all of it: over 800 ms on a generated 1798-module app booting `voltro serve` from the production bundle, and over a second on a loaded machine. Loading now hands the thread back every 25 ms; on the same app, at load 14 on 12 cores, the slowest liveness answer during boot was 89 ms. `voltro dev` loads its modules through the same path.
61
+ - **`voltro update` notes are not silenced by a comment naming the option** — `@voltro/cli`
62
+
63
+ A `manual` codemod decides whether your project is affected by searching its files. In code that search counted comments: an api config that set neither anonymous-tenant option and explained why in a comment read as one that had chosen, and the note meant for it was skipped as "none matched your project". Commented-out code did the same. In `.ts`, `.js` and `.json` files (and their variants) comments no longer count; prose files — runbooks, CI definitions, shell scripts — are still read whole. This applies to every codemod a later `voltro update` runs, including the ones of versions you have not crossed yet.
64
+ - **`voltro update` notes search the whole workspace, not only the app** — `@voltro/cli`
65
+
66
+ `voltro update` runs from an app directory, and the search behind every manual note read only that app. A compose file at the workspace root still setting `VOLTRO_DEV_HEALTH_PORT`, or a tsconfig in another workspace member with a removed TypeScript 7 option, got "nothing in this repository matched" — though the TypeScript 7 note says it checks every tsconfig in the workspace. The search now covers the workspace the app sits in. The TypeScript 7 note also names each tsconfig line it found, and its hand-check `git grep` line matches `"moduleResolution": "node"` and the lower-case spellings (`amd`, `classic`, `es5`); it required `node10` before.
67
+ - **Correction: a compose baseline from before 0.79.0 needs `voltro baseline sync`** — `@voltro/cli`
68
+
69
+ The 0.79.0 note on probes said a compose baseline needs nothing because it regenerates on the next `voltro dev`. It does not: only `voltro baseline sync` rewrites those files, and a baseline synced before 0.79.0 sets `VOLTRO_DEV_HEALTH_PORT` and points its healthchecks at a port nothing listens on any more. `voltro update` now prints a correcting note for every project whose workspace still sets that variable, naming the lines.
70
+ - **`db apply` undo converts tables back and says exactly what still differs** — `@voltro/cli`, `@voltro/database`
71
+
72
+ On MySQL, MariaDB, SQLite and Turso a failed `voltro db apply` is undone rather than rolled back. When the run had converted tables to a declared `store.charset`, the undo planned the way back with that same charset, so no conversion could be planned in reverse — and the check behind "the database is as it was" asked the same charset-blind question, so the line printed over tables that stayed converted. The undo now converts each table back to the character set its string columns had before the run, and verifies it by reading every column back. A column the undo redefines also keeps its default: a string default read from MariaDB was quoted a second time. When an undo does not read as it was, the report now lists each remaining difference instead of asking you to compare by hand.
73
+ - **The compose dev image starts pnpm 11 and later as the non-root user** — `@voltro/cli`
74
+
75
+ The `compose` and `compose-mariadb` baselines' `docker/dev.Dockerfile` activated pnpm as root but never ran it. pnpm 11 and later download a native binary on their first run, into a directory the non-root user compose starts every service as cannot write, so `docker compose … up` stopped at the first service with `EACCES … pnpm-native….tgz`. The image now runs pnpm once while it is built. Run `voltro baseline sync` and rebuild the image to take it.
76
+ - **The closed devtools capsule glows again** — `@voltro/devtools`
77
+
78
+ When the overlay became a docking console, the closed state turned into a status capsule and lost the launcher's animated halo: a bright slice of brand violet circling the rim while a soft glow breathes around it. The capsule carries it again, traced along its pill outline. It steps aside while `voltro dev` reports a status, where the capsule's own pulse in the status colour takes over, and it stands still under `prefers-reduced-motion`.
79
+ - **`db gc-snapshots` drops snapshots that reference each other, and works on MySQL** — `@voltro/cli`
80
+
81
+ `voltro db gc-snapshots` dropped snapshots in catalog order. Two tables one plan soft-dropped keep the foreign key between them, so dropping the parent first failed with `1451` on MySQL and MariaDB (and on Postgres whenever the parent came first), every run, after the snapshots before it were already gone; a soft-dropped reference column failed with `1553`. The keys the snapshots hold are now dropped first, then the columns, then the tables, a child before its parent. A snapshot that a table outside the set still references is refused before anything is dropped, with each constraint named. On MySQL 8 the command, and `voltro db restore-snapshot`, found no snapshot at all, because the catalog answers in upper case there; both read it now.
82
+ - **`voltro update` lists the lines a manual note is about** — `@voltro/cli`
83
+
84
+ A `manual` codemod decides between "found" and "nothing in this repository matched" with its own check, and that check could be narrower than the search its note tells you to run. The note for probes on the app port told readers to grep for `internal/(liveness|readiness|startup)` but looked only for `VOLTRO_DEV_HEALTH_PORT`, so a project whose Helm values, compose healthcheck and smoke script probed app port + 1 directly got "nothing in this repository matched" while every one of them needed moving. A manual note can now list the lines it is about, and `voltro update` prints them under it (`── found in this repository (N lines) — check each:`, `file:line text`). The probe note lists every probe path and variable it finds, with the port beside each probe; the anonymous-tenant note names each api config that sets neither option. A note that lists a line is reported as found.
85
+ - **MariaDB: a charset, type or nullability change keeps the column's CHECK** — `@voltro/database`
86
+
87
+ On MariaDB a CHECK written on the column itself — how a table with `text().oneOf([...])` is created — is part of the column definition, and `MODIFY COLUMN` without it removes it. Every operation that redefines a column did exactly that: a `convert-charset` rewrite, a nullability, type or default change. The re-plan then proposed `add-check` for each, and the apply refused with "the migration did not converge", after every statement had run. Declaring `store.charset` over an existing schema hit it once per converted enum column. The rewrite now restates each column's CHECK, so it stays where it was; an explicit `drop-check` still removes one the declaration no longer has. MySQL keeps such a CHECK on its own and is unchanged. `emitConvertCharsetMysql` takes the CHECKs to keep as an optional last argument, so every existing call compiles as before.
88
+ - **`voltro serve` checks pending file migrations from its bundle, not from source** — `@voltro/cli`, `@voltro/database`
89
+
90
+ Before it boots, `voltro serve` refuses when a `migrations/<timestamp>_<slug>.ts` file has never run. `voltro build` did not bundle those files, so serve imported each from source — and, through it, a second copy of the framework's migration code. Measured on an app with two file migrations: about 290 ms during which the process answered nothing, after the port was already taking health probes. The build now bundles every file migration, and serve reads them from the bundle. `pendingFileMigrationIds` takes an optional module importer as its last argument, and `walkMigrationFiles` is exported; every existing call compiles as before.
91
+ - **`voltro update --wait` says what the registry answered, per package** — `@voltro/cli`
92
+
93
+ `--wait` reported every package it could not confirm as "not on the registry", whether the registry had answered 404 or the request had failed. It now names the answer with each package — `404: not published yet`, or `no answer: <status or error>` — while it waits, at the ceiling, and after a failed install, so a network error is never reported as a missing release. In `pnpm-workspace.yaml`, a `minimumReleaseAgeExclude` entry that pnpm 12.5 and later widened in place to a version union (`'@voltro/ai@0.78.0 || 0.79.0'`) was skipped without a word; a union holding the version being left now moves to the target like any other entry.
94
+
95
+ ---
96
+
42
97
  ## [0.79.0] — 2026-09-23
43
98
 
44
99
  ### ⚠ BREAKING
package/dist/sql.d.ts CHANGED
@@ -2618,11 +2618,12 @@ export declare const emitAddIndexMysql: (op: Extract<MigrationOperation, {
2618
2618
  * the same renderer the type and nullability operations use), because MODIFY
2619
2619
  * redefines the column and the declaration is the shape the plan converges
2620
2620
  * to. A generated column keeps its expression — MODIFY without it would drop
2621
- * the generation.
2621
+ * the generation — and a column keeps its column-level CHECK (`checks`, read
2622
+ * by `columnLevelChecksMysql`) for the same reason.
2622
2623
  */
2623
2624
  export declare const emitConvertCharsetMysql: (op: Extract<MigrationOperation, {
2624
2625
  kind: "convert-charset";
2625
- }>, declared: ReadonlyArray<TableLike>) => {
2626
+ }>, declared: ReadonlyArray<TableLike>, checks?: ReadonlyMap<string, string>) => {
2626
2627
  readonly drops: ReadonlyArray<string>;
2627
2628
  readonly rewrite: string;
2628
2629
  readonly restores: ReadonlyArray<string>;
@@ -3587,6 +3588,16 @@ export declare interface MigrationLockScope {
3587
3588
  readonly schema?: string | undefined;
3588
3589
  }
3589
3590
 
3591
+ /**
3592
+ * How a migration file becomes a module. The default imports the file itself;
3593
+ * a caller that holds the app's modules already — `voltro serve` from its
3594
+ * precompiled bundle — passes its own, so a boot that only ASKS what is pending
3595
+ * does not import each file's source and, through it, a second copy of this
3596
+ * package's whole migration graph. Measured on a boot with two migrations:
3597
+ * ~290 ms of held event loop, after the port was already answering probes.
3598
+ */
3599
+ export declare type MigrationModuleImporter = (file: string) => Promise<Record<string, unknown>>;
3600
+
3590
3601
  /**
3591
3602
  * A migration context was built without a SQL client — over the in-memory
3592
3603
  * store, the shape a unit test uses — and the body reached a surface that
@@ -4205,7 +4216,9 @@ export declare const parseEnumCheck: (clause: string) => {
4205
4216
  */
4206
4217
  export declare const pendingFileMigrationIds: (sql: SqlClient.SqlClient, projectRoot: string,
4207
4218
  /** Absent: BOTH phases — a gate that asks "is anything pending at all". */
4208
- phase?: MigrationPhase) => Effect.Effect<ReadonlyArray<string>, unknown>;
4219
+ phase?: MigrationPhase,
4220
+ /** How each file is imported — see {@link MigrationModuleImporter}. */
4221
+ importModule?: MigrationModuleImporter) => Effect.Effect<ReadonlyArray<string>, unknown>;
4209
4222
 
4210
4223
  /**
4211
4224
  * What `runFileBasedMigrations` would execute next, with the one fact a deploy
@@ -6519,6 +6532,17 @@ export declare const VOLTRO_MIGRATION_LOCK_KEY = 6322741009312437n;
6519
6532
  /** Index-free for the same reason `_voltro_migration_ops` is: at most a row or two, ever. */
6520
6533
  export declare const _voltroDeploysTable: TableLike;
6521
6534
 
6535
+ /**
6536
+ * Walk for migration files. Recursive; skips common build dirs.
6537
+ * Returns absolute paths sorted by basename (= timestamp-ordered
6538
+ * because the convention puts the timestamp at the start).
6539
+ *
6540
+ * Exported for `voltro build`, which must bundle exactly the files this walk
6541
+ * finds: every one `voltro serve` loads that is not in the bundle is imported
6542
+ * from source instead.
6543
+ */
6544
+ export declare const walkMigrationFiles: (root: string) => Promise<ReadonlyArray<string>>;
6545
+
6522
6546
  /**
6523
6547
  * One aggregate column in a `SELECT` projection — `COUNT(*)`,
6524
6548
  * `SUM(amount) AS total`, etc. Built via the `count() / sum() /