Supabase CLI
Supabase's new CLI runs the full Supabase stack locally via Docker Compose, using the same tooling as production, and walks through wiring it to a React app. For migrations, Supabase prefers schema diffing over hand-written migration scripts. After evaluating migra, dbdiff, pgdiff, apgdiff, pgquarrel and pgAdmin Schema Diff, it picked pgAdmin's because it tracks VIEW owner changes, which Row Level Security on views depends on, and it also handles domains. Since pgAdmin's diff was GUI-only, Supabase built a CLI mode for it and shipped it as a Docker image. A `supabase eject` command emits docker-compose, Kong and Postgres configs for self-hosting.
Related posts
- Supabase Local Dev: migrations, branching, and observability
Supabase easyNoviceSupabase's CLI gains a batch of Postgres local-development features: `supabase inspect db` with 19 diagnostic commands adapted from Heroku's pg-extras, `db dump` backups built on pg_dump, migration squashing and diffing via migra, pgTAP testing with `supabase test`, plpgsql_check linting, seeding, and TypeScript type generation that now detects foreign-key relationships. Local logs are viewable in the dashboard, and the CLI moves to a fortnightly stable-release cycle with a beta channel. Branching enters alpha: each GitHub pull request gets an isolated Firecracker-based preview environment that runs the repo's migrations and seed.sql, with migrations applied to production on merge. Production data cloning is deliberately deferred until copy-on-write with anonymization is judged safe.
- Declarative Schemas for Simpler Database Management
Supabase mediumAdeptSupabase CLI now supports declarative schemas: the desired final state of Postgres tables, views, functions, RLS policies, grants and types lives in versioned .sql files, and a schema diff tool such as migra generates the migration files. Supabase used this internally for two years on its complex projects table, which sits in a private schema behind a public view with RLS-based ABAC and INSTEAD OF triggers. Previously, adding one column meant hand-copying view and trigger definitions into a migration of several hundred lines that conflicted often. Now it is a one-line diff, and generated migrations still get manual review. The team says this cut schema changes from hours to minutes and made rebasing much easier.
- Supabase CLI v1 and Management API Beta
Supabase mediumAdeptSupabase CLI v1 leaves beta with commands to manage organizations, projects and Edge Functions, plus database migration tooling, CI/CD workflows and TypeScript type generation. Schema diffing adds an experimental migra backend (`db diff --use-migra`), which runs faster and emits more concise DDL than the previous PgAdmin-based approach, which mishandled default privileges in role grants. Local database branching lets developers test manual migrations without data loss, and `db push` plus a GitHub Actions example cover releasing to staging and production. A beta REST Management API, already used by the CLI, exposes project and organization management for automation and future Terraform/Pulumi integrations.
- The Vibe Coder's Guide to Supabase Environments
Supabase mediumAdeptSeparate Supabase projects for development and production, with all schema changes captured as timestamped SQL migrations in a Git-tracked supabase/ directory, keep a fast workflow from breaking live data. Changes flow one way: local → dev → prod. Every migration is proven with `supabase db reset`, and GitHub Actions runs `supabase db push` automatically on merges to develop and main. The guide also covers enabling Row Level Security on every table, keeping service role keys out of NEXT_PUBLIC_ variables, nightly backups plus Point in Time Recovery with monthly restore drills, and wiring Vercel preview and production environments to the matching database.
- Supabase Branching
Supabase mediumAdeptSupabase Branching gives each Git branch an isolated hosted Preview environment with its own Postgres database, Auth, Storage, Realtime, Edge Functions and APIs, plus separate credentials. A GitHub app runs migrations from ./supabase/migrations when a PR opens, applies new migration files incrementally on push, seeds from seed.sql, and runs the migrations against production on merge. It integrates with Vercel Preview deployments by auto-populating branch connection secrets. Early access is rolling out in batches to paid orgs, with copy-on-write snapshots, declarative config and automatic dashboard commits planned.