Skip to content

feat(cli): add declarative schema apply command#5694

Open
ametel01 wants to merge 6 commits into
supabase:developfrom
ametel01:feat/declarative-apply-local
Open

feat(cli): add declarative schema apply command#5694
ametel01 wants to merge 6 commits into
supabase:developfrom
ametel01:feat/declarative-apply-local

Conversation

@ametel01

Copy link
Copy Markdown
Contributor

Summary

Adds supabase db schema declarative apply for applying existing declarative schema files directly to the local database via pg-delta.

This keeps the flow separate from timestamped migrations: it starts the local database when needed, mounts the configured declarative schema directory read-only, runs the pg-delta apply script, and leaves migration files/history untouched. The PR also wires the Go command surface, adds regression coverage, and documents the native legacy side effects.

Closes #5204.

@ametel01 ametel01 requested a review from a team as a code owner June 25, 2026 10:13

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 18966bf66e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/cli/src/legacy/commands/db/shared/legacy-pgdelta.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c405ae87e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/cli-go/cmd/db_schema_declarative.go

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 41971b471d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/cli/src/legacy/commands/db/schema/declarative/apply/apply.handler.ts Outdated
Comment thread apps/cli/src/legacy/commands/db/schema/declarative/apply/apply.handler.ts Outdated
Comment thread apps/cli/src/legacy/commands/db/schema/declarative/apply/apply.handler.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

declarative: Ability to import declarative schemas directly to local DB, without having to go through migrations

1 participant