ConnectPostgresHttp
Source:
src/Fly/ConnectPostgresHttp.tsKind: 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).
Provide the layer
Section titled “Provide the layer”Effect.gen(function* () { const conn = yield* Fly.ConnectPostgres(Db); const db = yield* Drizzle.Postgres(conn.connectionString);}).pipe(Effect.provide(Fly.ConnectPostgresHttp))