# Can I get a database per pull request?

> On Pro and above, branching copies a project (schema only, or with data) into a new project you can point a preview deployment at. How it works, what isn't copied and how to clean up.

Source: https://supahost.app/kb/preview-database-per-pr · Updated 2026-11-11

Yes, on Pro, Business and Enterprise. **Branching** creates a copy of a project, with or without its data, as a separate project with its own URL and keys. Point a preview deployment at the branch, test the pull request against it, then delete the branch. Branches are created from the dashboard; there's no automatic branch-per-PR integration with GitHub.

## Creating a branch

1. Dashboard → your project → **Branches** tab.
2. Enter a suffix. The branch is named `<parent>-<suffix>` (30 characters at most in total), for example `app-one-pr-142`.
3. Leave **Copy data, users and files** on to copy everything, or turn it off for a schema-only branch.

The parent stays online while the copy is made. The branch gets its own API URL:

```bash
# preview environment variables
SUPABASE_URL=https://app-one-pr-142.acme.supahost.space
SUPABASE_ANON_KEY=<the branch's anon key from Connect → App>
```

## What a branch contains

| | With data | Schema only |
|---|---|---|
| Tables, functions, policies, extensions | yes | yes |
| Rows in your tables | yes | emptied |
| Auth users | yes | emptied |
| Storage buckets | yes | yes (no files) |
| Storage files | copied | no |
| Migration history | yes | yes |

Not copied either way: Edge Functions, function secrets, cron jobs, Auth settings and OAuth providers, and custom domains. Deploy the functions your PR needs to the branch, and set its Site URL and redirect URLs in its **Auth** tab, for example `https://*.vercel.app/**`.

## Testing a migration on a branch

Apply the PR's migration to the branch first (Studio's SQL editor, or MCP `apply_migration` with a token scoped to the branch project). When it's merged, apply the same migration to the parent. There's no merge from branch to parent; the Branches page says the same.

## Limits

- Branching is available on Pro and above, and only the owner can create branches.
- You branch from a main project, not from another branch.
- Each branch counts as a project toward your plan (15 on Pro, 30 on Business; $3/month for each extra) and shares the instance's resources. During the trial, branches count toward the 3-project limit.

## FAQ

### Can branches be created automatically for every pull request?

Not with a built-in integration. Branches are created in the dashboard. For lightweight previews you can share one long-lived staging branch across PRs.

### Do branches include real user data?

With "Copy data, users and files" on, yes, including Auth users and files. Use a schema-only branch plus seed data when previews shouldn't hold production data.

### How do I remove a branch?

Delete it like any other project (project **…** menu → Delete project) once the PR is merged or closed.

## Related

- [Branching](/docs/platform/branching)
- [Migrations workflow: local to SupaHost](/docs/local-development/migrations-workflow)
- [Seeding data](/docs/local-development/seeding)
- [Can I use SupaHost with a Next.js app on Vercel?](/kb/nextjs-vercel)
