fix: add databaseUrlFromResource to deno

This commit is contained in:
Ruben Fiszel
2022-06-28 00:45:29 +02:00
parent 6bd96ed509
commit 1632600a01

View File

@@ -123,3 +123,8 @@ async function _transformLeaf(v: any): Promise<any> {
return v
}
}
export async function databaseUrlFromResource(path: string): Promise<string> {
const resource = await getResource(path)
return `postgresql://${resource.user}:${resource.password}@${resource.host}:${resource.port}/${resource.database}?sslmode=${resource.sslmode}`
}