From 1632600a01a16f0a61c7d349e925941301ac7660 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 28 Jun 2022 00:45:29 +0200 Subject: [PATCH] fix: add databaseUrlFromResource to deno --- deno-client/mod.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deno-client/mod.ts b/deno-client/mod.ts index 78180d35ae..29de3ba6ba 100644 --- a/deno-client/mod.ts +++ b/deno-client/mod.ts @@ -123,3 +123,8 @@ async function _transformLeaf(v: any): Promise { return v } } + +export async function databaseUrlFromResource(path: string): Promise { + const resource = await getResource(path) + return `postgresql://${resource.user}:${resource.password}@${resource.host}:${resource.port}/${resource.database}?sslmode=${resource.sslmode}` +}