Repository navigation
Allow cluster SQL storage to run without runtime DDL - #8897
Merged
Merged
Conversation
Add layerMigrations and layerStorage to SqlMessageStorage and SqlRunnerStorage, export their migration loaders, and add Migrator.pending. Runner storage now uses a migrator recorded in <prefix>_runner_migrations.
🦋 Changeset detectedLatest commit: 5875fc7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 32 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
effect-bot
force-pushed
the
v4/next-minor
branch
from
October 8, 2026 02:11
ef718b7 to
7410f95
Compare
… tables Turn MigrationError defects from failing migrations into typed failures for the storage migration layers, keeping the typed SqlError for runner storage constructors. Stop ignoring and endlessly retrying errors in the PostgreSQL message storage migration, which hung on any failure. Share a PostgreSQL migrations table lookup that quotes the name between Migrator.make and Migrator.pending.
effect-bot
force-pushed
the
v4/next-minor
branch
from
October 8, 2026 02:21
7410f95 to
7aa07f5
Compare
- Share the pending-migration rule between Migrator.make and Migrator.pending through latestMigrationId and selectPending. - Replace failOnMigrationDefect with a shared runMigrations helper that both storages call, using catchCauseFilter to keep other defects intact. - Define SqlMessageStorage.migrations directly so runMigrations no longer needs Effect.suspend, and build layerWith from layerMigrations. - Build SqlRunnerStorage.layerWith from make again, with the SqlError unwrapping inlined into make. - Drop no-op tuple maps and a duplicated assertion helper in the tests, and provision the empty history table with Migrator.make.
- Drop the layerMigrations/layerStorage cases from every dialect variant of the message and runner suites; the DML-only role suite covers DDL-free startup on PostgreSQL. - Keep the runner upgrade over existing tables as a single pg case. - Trim the DML-only role suite to startup under the restricted role and the typed migration failure regression, run sequentially, and stop importing the memory storage test module. - Drop the pglite pending case that the quoted-name case already covers.
tim-smart
reviewed
Oct 8, 2026
| import type { SqlError } from "../../sql/SqlError.ts" | ||
|
|
||
| /** @internal */ | ||
| export const runMigrations = (options: { |
Contributor
There was a problem hiding this comment.
Remove this. You can just use Effect.orDie on the migrator
tim-smart
reviewed
Oct 8, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cluster SQL storage can now use tables migrated by an owner connection while the application runs with a restricted database role.
Both
SqlMessageStorageandSqlRunnerStorageexposelayerMigrations,layerStorage, and migration loaders. Migration layers return typed errors; storage layers issue no table creation or startup schema checks. Existing constructors and default layers still migrate on startup and retain their error channels.Runner storage records migrations in
<prefix>_runner_migrationsand creates the locks table regardless of advisory lock settings. Existing runner tables and rows are preserved. PostgreSQL history-table lookup respects quoted names and handles concurrent table creation; message migration SQL failures now propagate instead of retrying in an aborted transaction.The changeset is a patch release.
Migrator.pendingis not included.Five focused regressions remain: restricted-role startup, migration failure propagation, legacy runner upgrade, concurrent history-table creation, and quoted history-table reuse. The test diff against the merge base with
mainis +217 lines, with pre-existing tests unchanged.Latest local validation: 40 tests pass across seven targeted files, including integration tests enabled with
EFFECT_INTEGRATION_TESTS=1;pnpm lint,pnpm check,pnpm jsdocs --check, andgit diff --checkpass. Toolchain commands ran throughnix develop -c.Closes #8894
Closes EFF-1838