joist-utils 2.0.3-next.9 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/connection.d.ts +10 -9
- package/build/connection.d.ts.map +1 -1
- package/build/connection.js +2 -2
- package/build/connection.js.map +1 -1
- package/package.json +1 -1
package/build/connection.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ConnectionConfig as PgConnectionConfig } from "pg";
|
|
2
1
|
type DatabaseUrlEnv = {
|
|
3
2
|
DATABASE_URL: string;
|
|
4
3
|
};
|
|
@@ -12,16 +11,18 @@ type DbSettingsEnv = {
|
|
|
12
11
|
};
|
|
13
12
|
export type ConnectionEnv = DatabaseUrlEnv | DbSettingsEnv;
|
|
14
13
|
/**
|
|
15
|
-
* A connection config with
|
|
14
|
+
* A simple connection config compatible with both `pg.Pool` and knex.
|
|
16
15
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* which is what we provide anyway.
|
|
20
|
-
*
|
|
21
|
-
* We also omit `types` and `stream` b/c Knex's `PgConnectionConfig` doesn't exactly match pg's.
|
|
16
|
+
* We use a plain object type instead of pg's `ConnectionConfig` to avoid
|
|
17
|
+
* pulling in pg-specific fields (like `types`) that are incompatible with knex.
|
|
22
18
|
*/
|
|
23
|
-
export type ConnectionConfig =
|
|
24
|
-
|
|
19
|
+
export type ConnectionConfig = {
|
|
20
|
+
user?: string;
|
|
21
|
+
password?: string;
|
|
22
|
+
database?: string;
|
|
23
|
+
host?: string;
|
|
24
|
+
port?: number;
|
|
25
|
+
ssl?: boolean;
|
|
25
26
|
};
|
|
26
27
|
/**
|
|
27
28
|
* Returns the `ConnectionConfig` that joist will use to connect to pg.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAEA,KAAK,cAAc,GAAG;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC;AAC/C,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,aAAa,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,CAAC,EAAE,aAAa,GAAG,gBAAgB,CA2B3E"}
|
package/build/connection.js
CHANGED
|
@@ -21,8 +21,8 @@ function newPgConnectionConfig(env) {
|
|
|
21
21
|
const options = (0, pg_connection_string_1.parse)(url);
|
|
22
22
|
const { database, port, host, user, password } = options;
|
|
23
23
|
return {
|
|
24
|
-
user,
|
|
25
|
-
password,
|
|
24
|
+
user: user ?? undefined,
|
|
25
|
+
password: password ?? undefined,
|
|
26
26
|
database: database ?? undefined,
|
|
27
27
|
host: host ?? undefined,
|
|
28
28
|
port: port ? Number(port) : undefined,
|
package/build/connection.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../src/connection.ts"],"names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