Skip to content

ConnectMySQLHttp

Source: src/Railway/ConnectMySQLHttp.ts Kind: Layer · Provides: Railway.ConnectMySQL

Implementation of ConnectMySQL. Provide it on the Service Effect.

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

Effect.gen(function* () {
const conn = yield* Railway.ConnectMySQL(Db);
const db = yield* Drizzle.MySQL(conn.connectionString);
}).pipe(Effect.provide(Railway.ConnectMySQLHttp))