PostgresDatabase
Source:
src/Planetscale/Postgres/PostgresDatabase.ts
A PostgreSQL PlanetScale database. For MySQL, use {@link MySQLDatabase} instead.
Creating a PostgreSQL Database
Section titled “Creating a PostgreSQL Database”const db = yield* Planetscale.PostgresDatabase("MyDb", { clusterSize: "PS_10",});Migrations and seed data
Section titled “Migrations and seed data”const db = yield* Planetscale.PostgresDatabase("MyDb", { clusterSize: "PS_10", migrationsDir: "./migrations/postgres", importFiles: ["./seed/postgres.sql"],});Adoption
Section titled “Adoption”import { adopt } from "alchemy/AdoptPolicy";
const db = yield* Planetscale.PostgresDatabase("Existing", { name: "existing-db", clusterSize: "PS_10",}).pipe(adopt());