What is a database branch?
A database branch is a copy-on-write clone of your database at a specific point in time. Each branch has its own connection string and can be modified independently without affecting other branches. This is similar to Git branches but for your database.Creating a branch
Branches are created through the Yboard dashboard or API:- From the dashboard — Use the Database section of your app to create a new branch from an existing one.
- Via the CLI — Running
yboard initcreates your first database branch automatically. - Via the API — Call the
createBranchaction with a project ID, branch name, and parent branch ID.
commitHash to branch from a specific point in time.
Branch limits
Each organization has a branch limit based on their subscription:
The default maximum is 25 branches per organization. Creating a branch when at the limit returns an error.
Check your current usage from the dashboard or via the
getBranchUsage action.
Deleting a branch
Remove branches you no longer need to stay within your limits:- Dashboard — Navigate to the branch and click Delete.
- API — Call
deleteBranchwith the project ID and branch ID.
Executing SQL
You can run SQL statements against any branch:Schema migrations
Yboard can generate and run schema migrations between branches using AI:- Diff detection — Compares schemas between a source branch and a target branch.
- Migration generation — Uses AI to generate idempotent SQL migration statements (with
CREATE IF NOT EXISTS,DROP IF EXISTS, etc.). - Execution — Runs the generated statements against the target branch.
- Error recovery — If a migration fails, AI analyzes the error and generates fix statements.
Inspecting your database
From the Database Viewer in the dashboard, you can:- Browse tables and their schemas.
- View row data with pagination.
- Inspect triggers and functions.
- See connection details (Project ID, Branch ID, connection URLs).
Database quotas
Resource usage is tracked per organization and enforced based on your subscription:
Free-tier users receive a fraction of the subscribed quotas (scaled by a 0.2x factor). See Account & Subscriptions for plan-specific limits.