@quillsql/node 0.1.2 → 0.1.4
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/index.js +1 -12
- package/index.ts +1 -13
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -8,22 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
11
|
const { Pool, Connection } = require("pg");
|
|
13
12
|
const axios = require("axios");
|
|
14
13
|
var PgError = require("pg-error");
|
|
15
14
|
Connection.prototype.parseE = PgError.parse;
|
|
16
15
|
Connection.prototype.parseN = PgError.parse;
|
|
17
|
-
|
|
18
|
-
if (!publicKey) {
|
|
19
|
-
throw new Error("No publicKey provided");
|
|
20
|
-
}
|
|
21
|
-
if (!privateKey) {
|
|
22
|
-
throw new Error("No privateKey provided");
|
|
23
|
-
}
|
|
24
|
-
if (!databaseConnectionString) {
|
|
25
|
-
throw new Error("No databaseConnectionString provided");
|
|
26
|
-
}
|
|
16
|
+
module.exports = ({ publicKey, privateKey, databaseConnectionString, stagingDatabaseConnectionString, }) => {
|
|
27
17
|
const pool = new Pool({ connectionString: databaseConnectionString });
|
|
28
18
|
const stagingPool = new Pool({
|
|
29
19
|
connectionString: stagingDatabaseConnectionString,
|
|
@@ -107,4 +97,3 @@ const quill = ({ publicKey, privateKey, databaseConnectionString, stagingDatabas
|
|
|
107
97
|
}),
|
|
108
98
|
};
|
|
109
99
|
};
|
|
110
|
-
exports.default = quill;
|
package/index.ts
CHANGED
|
@@ -21,22 +21,12 @@ interface QuillQueryParams {
|
|
|
21
21
|
environment?: string;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
module.exports = ({
|
|
25
25
|
publicKey,
|
|
26
26
|
privateKey,
|
|
27
27
|
databaseConnectionString,
|
|
28
28
|
stagingDatabaseConnectionString,
|
|
29
29
|
}: QuillConfig) => {
|
|
30
|
-
if (!publicKey) {
|
|
31
|
-
throw new Error("No publicKey provided");
|
|
32
|
-
}
|
|
33
|
-
if (!privateKey) {
|
|
34
|
-
throw new Error("No privateKey provided");
|
|
35
|
-
}
|
|
36
|
-
if (!databaseConnectionString) {
|
|
37
|
-
throw new Error("No databaseConnectionString provided");
|
|
38
|
-
}
|
|
39
|
-
|
|
40
30
|
const pool = new Pool({ connectionString: databaseConnectionString });
|
|
41
31
|
const stagingPool = new Pool({
|
|
42
32
|
connectionString: stagingDatabaseConnectionString,
|
|
@@ -157,5 +147,3 @@ const quill = ({
|
|
|
157
147
|
},
|
|
158
148
|
};
|
|
159
149
|
};
|
|
160
|
-
|
|
161
|
-
export default quill;
|