PostgresBranch
Source:
src/Planetscale/Postgres/PostgresBranch.ts
A PlanetScale branch of a {@link PostgresDatabase}. For MySQL branches use {@link MySQLBranch} instead.
Creating a Branch
Section titled “Creating a Branch”Branch from main
const branch = yield* Planetscale.PostgresBranch("Feature123", { database: "my-db", parentBranch: "main",});Branch from a PostgresDatabase resource
const db = yield* Planetscale.PostgresDatabase("MyDb", { clusterSize: "PS_10" });const branch = yield* Planetscale.PostgresBranch("Feature456", { database: db, parentBranch: "main",});Migrations and seed data
Section titled “Migrations and seed data”const branch = yield* Planetscale.PostgresBranch("Feature123", { database: db, parentBranch: "main", migrationsDir: "./migrations", importFiles: ["./seed.sql"],});