feat(cli): use stack EphemeralPostgres for schema-tooling shadows - #6540
Draft
avallete wants to merge 15 commits into
Draft
feat(cli): use stack EphemeralPostgres for schema-tooling shadows#6540avallete wants to merge 15 commits into
avallete wants to merge 15 commits into
Conversation
Contributor
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase/cli/supabase@bcc62728d19c93a1cd748e7dd832c2a3c9c05f25Preview package for commit |
avallete
changed the base branch from
feat/stack-command-options
to
feat/stack-options-develop
September 11, 2026 15:46
When [experimental].stack is on, db diff/pull, declarative generate/sync, and migration squash provision throwaway shadows through @supabase/stack instead of legacy Docker SQL-template containers.
avallete
marked this pull request as draft
September 11, 2026 16:10
The stack backend resolved --local through stack credentials, but only pg-delta and squash runtimes provided the API, so migration up failed as not running. Move shared stack helpers out of the experimental command family, fail closed on local reset, skip Docker image inspect, and use stack credentials for declarative --local.
When [experimental].stack is on, db start/reset/dump/test and squash use stack credentials and resetDatabase instead of Compose. Native engines use PATH pg_dump/pg_prove; docker engines keep the tool container.
…Postgres Restored snapshots skip bootstrap, so the cache key now uses the same internal database constants. Interrupt owns the cluster on the start fiber so Postgres cannot stay bound, and remaining oxfmt drift is formatted.
…urces Reuse the shadow-cache JSON helper, snapshot new error tags, and mask container create-to-ID so Ctrl-C cannot orphan Docker/Podman objects.
avallete
force-pushed
the
feat/stack-ephemeral-postgres
branch
from
September 11, 2026 17:15
bcc6272 to
d34d089
Compare
Keep develop's Effect-valued stack lifecycle API and re-apply resetDatabase, postgres-only db start, and EphemeralPostgres on top of it.
db/migration and db-bootstrap cannot import experimental command internals, and knip flagged an unused local-running probe.
Omitted runtime now probes Docker. Declarative local ensure uses the postgres-only start helper so it cannot undo db start's overlay.
A failed first db start leaves an unconfigured identity; the retry must not compile the full default stack.
Include the new command-internal stack modules in Effect lint, make ephemeral Postgres start/stop Effect properties, and report PATH pg_dump/pg_prove failures instead of a container exit.
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.
Summary
When
[experimental].stack/SUPABASE_EXPERIMENTAL_STACKis on,db diff,db pull, declarative generate/sync, andmigration squashuse the project stack for--localand provision throwaway shadow Postgres through a new public@supabase/stackEphemeralPostgresAPI. Flag off keeps the legacy Docker SQL-template shadows.The cluster is a scoped second instance (native host PGDATA or a named volume), not a
listStacksidentity. Snapshots are runtime-kind specific. Cache files live understack-shadow-baseline-*.tarwith the same keep-3 / 2-day TTL as the legacy namespace. The stack backend requires in-process pg-delta;--use-migra,--use-pgadmin,--use-pg-schema, and--diff-engine migraare rejected.db reset --localand declarative--apply/--resetwipe Postgres throughresetDatabaseand then migrate or seed on stack credentials.Stacked on #6517.