Skip to content

ConnectPostgresHttp

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

Implementation of ConnectPostgres. Provide it on the Service or Function Effect.

At deploy time this packs the private connection URI onto the host (RAILWAY_POSTGRES_*, DATABASE_URL). At runtime the client reads process.env.

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