Filed unlabelled by the domain:cli execution seat while implementing #11733 (session 019siH5jDmk5hrayvfyojUqR). Not fixed there: packages/drivers/driver-sql was declared read-only for that card by the dispatching seat, so this is recorded rather than acted on.
The fact
packages/drivers/driver-sql/src/schema-drift.ts exports the remedy builder from its module:
packages/drivers/driver-sql/src/schema-drift.ts:499 export function manualJsonConversionSql(dialect: SqlDialectName, table: string, column: string): string
src/index.ts re-exports two blocks from ./schema-drift.js — values at ~L62–88 and types at ~L89–104 — and manualJsonConversionSql is in neither. Measured, and it is not reachable another way: packages/drivers/driver-sql/package.json declares only "." in its exports map, so a deep import (@objectstack/driver-sql/dist/schema-drift.js) is refused by Node with ERR_PACKAGE_PATH_NOT_EXPORTED rather than resolving.
Why it matters
That statement is the one thing #11720 says most emphatically must not be re-derived: two of its arms were corrected by running the earlier version against a live server (json_build_array over to_json; the explicit IS NULL arm, because json_build_array(NULL) is [null]). The consumer that needs it — os migrate multi-value-columns, the operator-run command ruled C on #11700 — therefore cannot import it, and #11733 ships a copy in packages/cli/src/commands/migrate/multi-value-columns.ts instead.
The copy is guarded, twice, so this is a cleanup rather than a live defect:
- runtime — the command refuses to execute any statement the engine's own finding message does not contain verbatim, so it can only ever run SQL
driver-sql printed for that exact table, column and dialect; - test —
multi-value-columns.remedy-fidelity.test.ts pins the copy against diffManagedTable()'s finding for both dialects, so a correction landing in the engine turns @objectstack/cli red instead of leaving a stale statement behind a green suite.
Both guards exist only because the import does not. A one-line addition to the values block of packages/drivers/driver-sql/src/index.ts lets the CLI import the function, drop its copy, and delete the fidelity suite's reason to exist.
Suggested shape
- add
manualJsonConversionSql to the existing export { … } from './schema-drift.js' values block; - in
packages/cli/src/commands/migrate/multi-value-columns.ts, replace the local multiValueJsonMigrationSql with the import (the runtime containment guard can stay — it is cheap and it also validates the dialect, which is read off the finding rather than off a client-name table); - reduce
multi-value-columns.remedy-fidelity.test.ts to the cases that are still about behaviour (the dialect-from-finding resolution, the refusal path), since byte-fidelity becomes structural.
Triage note: the #11733 retriage verdict (comment 5399478178) already designated this one line as includable in a domain:cli PR under a cross-domain single-PR designation; the dispatching seat narrowed the surface instead. Whichever lane takes it, packages/drivers/driver-sql/src/index.ts is a different file from the sql-driver.ts hot-file serial queue.
Related
Filed unlabelled by the
domain:cliexecution seat while implementing #11733 (session019siH5jDmk5hrayvfyojUqR). Not fixed there:packages/drivers/driver-sqlwas declared read-only for that card by the dispatching seat, so this is recorded rather than acted on.The fact
packages/drivers/driver-sql/src/schema-drift.tsexports the remedy builder from its module:src/index.tsre-exports two blocks from./schema-drift.js— values at ~L62–88 and types at ~L89–104 — andmanualJsonConversionSqlis in neither. Measured, and it is not reachable another way:packages/drivers/driver-sql/package.jsondeclares only"."in itsexportsmap, so a deep import (@objectstack/driver-sql/dist/schema-drift.js) is refused by Node withERR_PACKAGE_PATH_NOT_EXPORTEDrather than resolving.Why it matters
That statement is the one thing #11720 says most emphatically must not be re-derived: two of its arms were corrected by running the earlier version against a live server (
json_build_arrayoverto_json; the explicitIS NULLarm, becausejson_build_array(NULL)is[null]). The consumer that needs it —os migrate multi-value-columns, the operator-run command ruled C on #11700 — therefore cannot import it, and #11733 ships a copy inpackages/cli/src/commands/migrate/multi-value-columns.tsinstead.The copy is guarded, twice, so this is a cleanup rather than a live defect:
driver-sqlprinted for that exact table, column and dialect;multi-value-columns.remedy-fidelity.test.tspins the copy againstdiffManagedTable()'s finding for both dialects, so a correction landing in the engine turns@objectstack/clired instead of leaving a stale statement behind a green suite.Both guards exist only because the import does not. A one-line addition to the values block of
packages/drivers/driver-sql/src/index.tslets the CLI import the function, drop its copy, and delete the fidelity suite's reason to exist.Suggested shape
manualJsonConversionSqlto the existingexport { … } from './schema-drift.js'values block;packages/cli/src/commands/migrate/multi-value-columns.ts, replace the localmultiValueJsonMigrationSqlwith the import (the runtime containment guard can stay — it is cheap and it also validates the dialect, which is read off the finding rather than off a client-name table);multi-value-columns.remedy-fidelity.test.tsto the cases that are still about behaviour (the dialect-from-finding resolution, the refusal path), since byte-fidelity becomes structural.Triage note: the #11733 retriage verdict (comment 5399478178) already designated this one line as includable in a
domain:cliPR under a cross-domain single-PR designation; the dispatching seat narrowed the surface instead. Whichever lane takes it,packages/drivers/driver-sql/src/index.tsis a different file from thesql-driver.tshot-file serial queue.Related