@devries-cameron20 / t3code Mirror · read-only
Fork 0

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, 06:00 UTC

main
ts 19 lines 674 Bytes
Raw
1 import * as AWS from "@alchemy.run/aws";
2 import * as Drizzle from "@alchemy.run/drizzle/Postgres";
3 import * as Effect from "effect/Effect";
4 import * as Redacted from "effect/Redacted";
5 import { Database } from "./database.ts";
6
7 export const connectDatabase = Effect.gen(function* () {
8 const cluster = yield* Database;
9 const connect = yield* AWS.DSQL.Connect(cluster, { username: "app_user" });
10 return yield* Drizzle.Postgres(
11 connect.pipe(
12 Effect.map((connection) => {
13 const url = new URL(Redacted.value(connection.url));
14 url.searchParams.set("sslmode", "verify-full");
15 return Redacted.make(url.toString());
16 }),
17 ),
18 );
19 });