@ps-aux/nodebup 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -26,7 +26,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
26
26
|
const parseConnectionUrl = url => {
|
27
27
|
var _url$match;
|
28
28
|
|
29
|
-
|
29
|
+
// TODO what if there are query params in the end?
|
30
|
+
const regex = /postgres:\/\/(?<username>.*):(?<password>.*)@(?<host>.*):(?<port>\d*)(\/(?<database>.*))?$/;
|
30
31
|
const match = (_url$match = url.match(regex)) === null || _url$match === void 0 ? void 0 : _url$match.groups;
|
31
32
|
if (!match || !match.username || !match.password || !match.host || !match.port) throw new Error(`The Postgres connection URL does not match required regex: ${regex.toString()}`);
|
32
33
|
return {
|