Skip to content

PostgresDatabase

Source: src/Planetscale/Postgres/PostgresDatabase.ts

A PostgreSQL PlanetScale database. For MySQL, use {@link MySQLDatabase} instead.

const db = yield* Planetscale.PostgresDatabase("MyDb", {
clusterSize: "PS_10",
});
const db = yield* Planetscale.PostgresDatabase("MyDb", {
clusterSize: "PS_10",
migrationsDir: "./migrations/postgres",
importFiles: ["./seed/postgres.sql"],
});
import { adopt } from "alchemy/AdoptPolicy";
const db = yield* Planetscale.PostgresDatabase("Existing", {
name: "existing-db",
clusterSize: "PS_10",
}).pipe(adopt());