Loading…
Supabase CLI v1 and Management API Beta
soedirgo,qiao
- Source
- Supabase
- Published
- Added to Yomu
Summary
Supabase CLI v1 is moving out of beta with capabilities for managing database migrations and generating TypeScript types, alongside a beta Management API. The CLI can manage organizations and projects, link projects locally, run schema and manual migration workflows, support CI/CD through local and GitHub Actions workflows, and generate types from local or remote databases. Migration changes include improved manually written migrations, an experimental migra-backed db diff that is faster and produces more concise DDL, and local branching for testing DDL without data loss; the source notes that generated scripts are not perfect. The REST-based Management API, previously called the Admin API, is consumed by the CLI and exposes programmatic management of organizations, projects, Edge Functions, and more, with endpoints intended for CI/CD and test-environment creation.
Context
The CLI is moving out of beta, while the release responds to requests for more database migration support. The Management API is introduced to enable programmatic management of Supabase projects and organizations, particularly for CI/CD workflows and spinning up test environments.
Approach / What changed
Supabase extended the CLI with organization and project management, local linking, migration workflows, TypeScript type generation, and CI/CD support. It introduced migra behind an experimental flag for schema diffs, local database branching for testing manual migrations, and a beta REST Management API consumed by the CLI.
Takeaways
- The experimental supabase db diff --use-migra option compares a local public schema with a fresh shadow database and generates a migration DDL file; migra is described as faster and more concise, but its scripts are not perfect.
- Local branching allows manual DDL migrations to be tested without data loss by cloning a local database, switching to the new branch, and deleting it after returning to the main branch.
- The beta Management API provides public REST endpoints for managing organizations, projects, Edge Functions, and more, and is presented as a foundation for CI/CD, test environments, and integrations such as Terraform and Pulumi.