The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import * as Drizzle from "@alchemy.run/drizzle"; |
| 2 | import * as Fly from "@alchemy.run/fly"; |
| 3 | /** |
| 4 | * Fly.io Managed Postgres + Drizzle, queried from an HTTP Service. |
| 5 | * |
| 6 | * Billed (~$38/mo Basic). |
| 7 | */ |
| 8 | import * as Alchemy from "alchemy"; |
| 9 | import * as Effect from "effect/Effect"; |
| 10 | import * as Layer from "effect/Layer"; |
| 11 | import Api from "./src/api.ts"; |
| 12 | import { Db, Schema } from "./src/shared.ts"; |
| 13 | |
| 14 | export default Alchemy.Stack( |
| 15 | "FlyPostgres", |
| 16 | { |
| 17 | providers: Layer.mergeAll(Fly.providers(), Drizzle.providers()), |
| 18 | state: Alchemy.localState(), |
| 19 | }, |
| 20 | Effect.gen(function* () { |
| 21 | const schema = yield* Schema; |
| 22 | const db = yield* Db; |
| 23 | const api = yield* Api; |
| 24 | |
| 25 | return { |
| 26 | appName: api.appName, |
| 27 | clusterId: db.clusterId, |
| 28 | clusterName: db.name, |
| 29 | region: db.region, |
| 30 | migrations: schema.migrations, |
| 31 | apiUrl: api.url, |
| 32 | }; |
| 33 | }), |
| 34 | ); |