Skip to content

ConnectPostgresHttp

Source: src/Fly/ConnectPostgresHttp.ts Kind: Layer · Provides: Fly.ConnectPostgres

Implementation of ConnectPostgres. Provide it on the Service Effect.

At deploy time this registers the cluster on the host so Service reconcile can attach it (6PN) and pack the connection URI. At runtime the client reads process.env (FLY_POSTGRES_*, then Fly’s DATABASE_URL secret).

Effect.gen(function* () {
const conn = yield* Fly.ConnectPostgres(Db);
const db = yield* Drizzle.Postgres(conn.connectionString);
}).pipe(Effect.provide(Fly.ConnectPostgresHttp))