The best way to control Claude Code, Codex and more from any computer or phone

main
ts 24 lines 932 Bytes
Raw
1 import { PostgresDatabase } from "@alchemy.run/planetscale/Postgres/PostgresDatabase";
2 import { PostgresRole } from "@alchemy.run/planetscale/Postgres/PostgresRole";
3 import * as Effect from "effect/Effect";
4
5 /**
6 * PlanetScale Postgres used as the container's DATABASE_URL. Like Neon,
7 * PlanetScale has no local emulator — the pooled URL is a cloud host, so
8 * the loopback rewrite must leave it alone.
9 *
10 * The database name is deterministic so reruns adopt the same cluster
11 * instead of provisioning a new PS_10 every time (same trick as the
12 * PlanetScale Hyperdrive fixture).
13 */
14 export const PlanetscaleHostRole = Effect.gen(function* () {
15 const database = yield* PostgresDatabase("PlanetscaleHostDb", {
16 name: "alchemy-container-pg-host",
17 region: { slug: "us-east" },
18 clusterSize: "PS_10",
19 });
20 return yield* PostgresRole("PlanetscaleHostRole", {
21 database,
22 inheritedRoles: ["postgres"],
23 });
24 });