Branch
Source:
src/Prisma/Branch.ts
A Prisma project branch for preview-class databases and compute resources.
Standalone Branch resources always have the preview role. Promotion
changes only the default branch; Alchemy restores the previous default
before deleting a promoted branch.
Creating a Branch
Section titled “Creating a Branch”const branch = yield* Prisma.Branch("preview", { project: project.projectId, gitName: "feature/search", // optional — omitted, a stable name is generated});
branch.role; // "preview"branch.isDefault; // falsePromoting a Branch
Section titled “Promoting a Branch”const release = yield* Prisma.Branch("release", { project, gitName: "release/next", isDefault: true,});
release.role; // still "preview"release.isDefault; // true