MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / resolveConnectionString

Function resolveConnectionString

apps/cloud/src/db/db.ts:43–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41};
42
43export const resolveConnectionString = () => {
44 // Production should always use Hyperdrive when the binding exists. Keeping
45 // DATABASE_URL as a higher-priority fallback made it too easy for a deployed
46 // secret to silently bypass Hyperdrive.
47 if (env.EXECUTOR_DIRECT_DATABASE_URL === "true" && env.DATABASE_URL) {
48 return env.DATABASE_URL;
49 }
50 return env.HYPERDRIVE?.connectionString || env.DATABASE_URL || "";
51};
52
53const makeSql = (): Sql =>
54 postgres(resolveConnectionString(), {

Callers 2

makeDbHandleFunction · 0.90
makeSqlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected