joist-orm 2.3.0-next.41 → 2.3.0-next.43
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/_virtual/_rolldown/runtime.cjs +23 -0
- package/build/_virtual/_rolldown/runtime.js +5 -0
- package/build/codegen.cjs +19 -0
- package/build/codegen.cjs.map +1 -0
- package/build/codegen.d.cts +1 -0
- package/build/codegen.d.mts +1 -0
- package/build/codegen.js +11 -28
- package/build/codegen.js.map +1 -1
- package/build/drivers/PostgresDriver.cjs +290 -0
- package/build/drivers/PostgresDriver.cjs.map +1 -0
- package/build/drivers/PostgresDriver.d.cts +77 -0
- package/build/drivers/PostgresDriver.d.cts.map +1 -0
- package/build/drivers/PostgresDriver.d.mts +77 -0
- package/build/drivers/PostgresDriver.d.mts.map +1 -0
- package/build/drivers/PostgresDriver.js +249 -325
- package/build/drivers/PostgresDriver.js.map +1 -1
- package/build/drivers/WireRowData.cjs +374 -0
- package/build/drivers/WireRowData.cjs.map +1 -0
- package/build/drivers/WireRowData.d.cts +111 -0
- package/build/drivers/WireRowData.d.cts.map +1 -0
- package/build/drivers/WireRowData.d.mts +111 -0
- package/build/drivers/WireRowData.d.mts.map +1 -0
- package/build/drivers/WireRowData.js +352 -412
- package/build/drivers/WireRowData.js.map +1 -1
- package/build/drivers/binaryParsers.cjs +422 -0
- package/build/drivers/binaryParsers.cjs.map +1 -0
- package/build/drivers/{binaryParsers.d.ts → binaryParsers.d.cts} +18 -14
- package/build/drivers/binaryParsers.d.cts.map +1 -0
- package/build/drivers/binaryParsers.d.mts +80 -0
- package/build/drivers/binaryParsers.d.mts.map +1 -0
- package/build/drivers/binaryParsers.js +315 -385
- package/build/drivers/binaryParsers.js.map +1 -1
- package/build/drivers/patchPgProtocol.cjs +255 -0
- package/build/drivers/patchPgProtocol.cjs.map +1 -0
- package/build/drivers/{patchPgProtocol.d.ts → patchPgProtocol.d.cts} +18 -14
- package/build/drivers/patchPgProtocol.d.cts.map +1 -0
- package/build/drivers/patchPgProtocol.d.mts +47 -0
- package/build/drivers/patchPgProtocol.d.mts.map +1 -0
- package/build/drivers/patchPgProtocol.js +211 -232
- package/build/drivers/patchPgProtocol.js.map +1 -1
- package/build/graphql-codegen-export.cjs +10 -0
- package/build/graphql-codegen-export.d.cts +1 -0
- package/build/graphql-codegen-export.d.mts +1 -0
- package/build/graphql-codegen-export.js +2 -19
- package/build/graphql-export.cjs +10 -0
- package/build/graphql-export.d.cts +1 -0
- package/build/graphql-export.d.mts +1 -0
- package/build/graphql-export.js +2 -19
- package/build/index.cjs +41 -0
- package/build/index.d.cts +3 -0
- package/build/index.d.mts +3 -0
- package/build/index.js +3 -27
- package/build/knex-export.cjs +10 -0
- package/build/knex-export.d.cts +1 -0
- package/build/knex-export.d.mts +1 -0
- package/build/knex-export.js +2 -19
- package/build/pg-export.cjs +13 -0
- package/build/pg-export.d.cts +4 -0
- package/build/pg-export.d.mts +4 -0
- package/build/pg-export.js +4 -20
- package/build/pg-migrate.cjs +22 -0
- package/build/pg-migrate.cjs.map +1 -0
- package/build/pg-migrate.d.cts +1 -0
- package/build/pg-migrate.d.mts +1 -0
- package/build/pg-migrate.js +13 -28
- package/build/pg-migrate.js.map +1 -1
- package/build/seed.cjs +49 -0
- package/build/seed.cjs.map +1 -0
- package/build/{seed.d.ts → seed.d.cts} +5 -1
- package/build/seed.d.cts.map +1 -0
- package/build/seed.d.mts +24 -0
- package/build/seed.d.mts.map +1 -0
- package/build/seed.js +39 -45
- package/build/seed.js.map +1 -1
- package/build/tests-export.cjs +10 -0
- package/build/tests-export.d.cts +1 -0
- package/build/tests-export.d.mts +1 -0
- package/build/tests-export.js +2 -19
- package/package.json +150 -28
- package/build/codegen.d.ts +0 -2
- package/build/drivers/PostgresDriver.d.ts +0 -73
- package/build/drivers/WireRowData.d.ts +0 -107
- package/build/graphql-codegen-export.d.ts +0 -1
- package/build/graphql-codegen-export.js.map +0 -1
- package/build/graphql-export.d.ts +0 -1
- package/build/graphql-export.js.map +0 -1
- package/build/index.d.ts +0 -3
- package/build/index.js.map +0 -1
- package/build/knex-export.d.ts +0 -1
- package/build/knex-export.js.map +0 -1
- package/build/pg-export.d.ts +0 -3
- package/build/pg-export.js.map +0 -1
- package/build/pg-migrate.d.ts +0 -2
- package/build/tests-export.d.ts +0 -1
- package/build/tests-export.js.map +0 -1
package/build/graphql-export.js
CHANGED
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
// Re-export everything from joist-graphql-resolver-utils
|
|
18
|
-
__exportStar(require("joist-graphql-resolver-utils"), exports);
|
|
19
|
-
//# sourceMappingURL=graphql-export.js.map
|
|
1
|
+
export * from "joist-graphql-resolver-utils";
|
|
2
|
+
export {};
|
package/build/index.cjs
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let joist_utils = require("joist-utils");
|
|
3
|
+
Object.defineProperty(exports, "Deferred", {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
get: function() {
|
|
6
|
+
return joist_utils.Deferred;
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
Object.defineProperty(exports, "groupBy", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return joist_utils.groupBy;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "isPlainObject", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function() {
|
|
18
|
+
return joist_utils.isPlainObject;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports, "keyBy", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return joist_utils.keyBy;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports, "newPgConnectionConfig", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function() {
|
|
30
|
+
return joist_utils.newPgConnectionConfig;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
var joist_core = require("joist-core");
|
|
34
|
+
Object.keys(joist_core).forEach(function(k) {
|
|
35
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function() {
|
|
38
|
+
return joist_core[k];
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
});
|
package/build/index.js
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.newPgConnectionConfig = exports.keyBy = exports.isPlainObject = exports.groupBy = exports.Deferred = void 0;
|
|
18
|
-
// Re-export everything from joist-core
|
|
19
|
-
__exportStar(require("joist-core"), exports);
|
|
20
|
-
// Re-export from joist-utils (excluding 'fail' which is already exported by joist-core)
|
|
21
|
-
var joist_utils_1 = require("joist-utils");
|
|
22
|
-
Object.defineProperty(exports, "Deferred", { enumerable: true, get: function () { return joist_utils_1.Deferred; } });
|
|
23
|
-
Object.defineProperty(exports, "groupBy", { enumerable: true, get: function () { return joist_utils_1.groupBy; } });
|
|
24
|
-
Object.defineProperty(exports, "isPlainObject", { enumerable: true, get: function () { return joist_utils_1.isPlainObject; } });
|
|
25
|
-
Object.defineProperty(exports, "keyBy", { enumerable: true, get: function () { return joist_utils_1.keyBy; } });
|
|
26
|
-
Object.defineProperty(exports, "newPgConnectionConfig", { enumerable: true, get: function () { return joist_utils_1.newPgConnectionConfig; } });
|
|
27
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { Deferred, groupBy, isPlainObject, keyBy, newPgConnectionConfig } from "joist-utils";
|
|
2
|
+
export * from "joist-core";
|
|
3
|
+
export { Deferred, groupBy, isPlainObject, keyBy, newPgConnectionConfig };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
var joist_knex = require("joist-knex");
|
|
3
|
+
Object.keys(joist_knex).forEach(function(k) {
|
|
4
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
get: function() {
|
|
7
|
+
return joist_knex[k];
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "joist-knex";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "joist-knex";
|
package/build/knex-export.js
CHANGED
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
// Re-export everything from joist-knex
|
|
18
|
-
__exportStar(require("joist-knex"), exports);
|
|
19
|
-
//# sourceMappingURL=knex-export.js.map
|
|
1
|
+
export * from "joist-knex";
|
|
2
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_drivers_binaryParsers = require("./drivers/binaryParsers.cjs");
|
|
3
|
+
const require_drivers_PostgresDriver = require("./drivers/PostgresDriver.cjs");
|
|
4
|
+
const require_seed = require("./seed.cjs");
|
|
5
|
+
exports.PostgresDriver = require_drivers_PostgresDriver.PostgresDriver;
|
|
6
|
+
exports.binaryArrayParser = require_drivers_binaryParsers.binaryArrayParser;
|
|
7
|
+
exports.binaryTextParser = require_drivers_binaryParsers.binaryTextParser;
|
|
8
|
+
exports.getBinaryTypeParser = require_drivers_binaryParsers.getBinaryTypeParser;
|
|
9
|
+
exports.registerDatabaseBinaryParsers = require_drivers_binaryParsers.registerDatabaseBinaryParsers;
|
|
10
|
+
exports.seed = require_seed.seed;
|
|
11
|
+
exports.setBinaryTypeParser = require_drivers_binaryParsers.setBinaryTypeParser;
|
|
12
|
+
exports.setSessionTimeZone = require_drivers_binaryParsers.setSessionTimeZone;
|
|
13
|
+
exports.setupLatestPgTypes = require_drivers_PostgresDriver.setupLatestPgTypes;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PostgresDriver, PostgresDriverOpts, setupLatestPgTypes } from "./drivers/PostgresDriver.cjs";
|
|
2
|
+
import { BinaryParse, binaryArrayParser, binaryTextParser, getBinaryTypeParser, registerDatabaseBinaryParsers, setBinaryTypeParser, setSessionTimeZone } from "./drivers/binaryParsers.cjs";
|
|
3
|
+
import { seed } from "./seed.cjs";
|
|
4
|
+
export { type BinaryParse, PostgresDriver, type PostgresDriverOpts, binaryArrayParser, binaryTextParser, getBinaryTypeParser, registerDatabaseBinaryParsers, seed, setBinaryTypeParser, setSessionTimeZone, setupLatestPgTypes };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PostgresDriver, PostgresDriverOpts, setupLatestPgTypes } from "./drivers/PostgresDriver.mjs";
|
|
2
|
+
import { BinaryParse, binaryArrayParser, binaryTextParser, getBinaryTypeParser, registerDatabaseBinaryParsers, setBinaryTypeParser, setSessionTimeZone } from "./drivers/binaryParsers.mjs";
|
|
3
|
+
import { seed } from "./seed.mjs";
|
|
4
|
+
export { type BinaryParse, PostgresDriver, type PostgresDriverOpts, binaryArrayParser, binaryTextParser, getBinaryTypeParser, registerDatabaseBinaryParsers, seed, setBinaryTypeParser, setSessionTimeZone, setupLatestPgTypes };
|
package/build/pg-export.js
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// LazyDataRowMessage, isRowDataCapableClient) are deliberately not exported: they are
|
|
6
|
-
// implementation details of `lazyRows`, not public API. The binary parser registry is the
|
|
7
|
-
// supported extension point.
|
|
8
|
-
var binaryParsers_js_1 = require("./drivers/binaryParsers.js");
|
|
9
|
-
Object.defineProperty(exports, "binaryArrayParser", { enumerable: true, get: function () { return binaryParsers_js_1.binaryArrayParser; } });
|
|
10
|
-
Object.defineProperty(exports, "binaryTextParser", { enumerable: true, get: function () { return binaryParsers_js_1.binaryTextParser; } });
|
|
11
|
-
Object.defineProperty(exports, "getBinaryTypeParser", { enumerable: true, get: function () { return binaryParsers_js_1.getBinaryTypeParser; } });
|
|
12
|
-
Object.defineProperty(exports, "registerDatabaseBinaryParsers", { enumerable: true, get: function () { return binaryParsers_js_1.registerDatabaseBinaryParsers; } });
|
|
13
|
-
Object.defineProperty(exports, "setBinaryTypeParser", { enumerable: true, get: function () { return binaryParsers_js_1.setBinaryTypeParser; } });
|
|
14
|
-
Object.defineProperty(exports, "setSessionTimeZone", { enumerable: true, get: function () { return binaryParsers_js_1.setSessionTimeZone; } });
|
|
15
|
-
var PostgresDriver_js_1 = require("./drivers/PostgresDriver.js");
|
|
16
|
-
Object.defineProperty(exports, "PostgresDriver", { enumerable: true, get: function () { return PostgresDriver_js_1.PostgresDriver; } });
|
|
17
|
-
Object.defineProperty(exports, "setupLatestPgTypes", { enumerable: true, get: function () { return PostgresDriver_js_1.setupLatestPgTypes; } });
|
|
18
|
-
var seed_js_1 = require("./seed.js");
|
|
19
|
-
Object.defineProperty(exports, "seed", { enumerable: true, get: function () { return seed_js_1.seed; } });
|
|
20
|
-
//# sourceMappingURL=pg-export.js.map
|
|
1
|
+
import { binaryArrayParser, binaryTextParser, getBinaryTypeParser, registerDatabaseBinaryParsers, setBinaryTypeParser, setSessionTimeZone } from "./drivers/binaryParsers.js";
|
|
2
|
+
import { PostgresDriver, setupLatestPgTypes } from "./drivers/PostgresDriver.js";
|
|
3
|
+
import { seed } from "./seed.js";
|
|
4
|
+
export { PostgresDriver, binaryArrayParser, binaryTextParser, getBinaryTypeParser, registerDatabaseBinaryParsers, seed, setBinaryTypeParser, setSessionTimeZone, setupLatestPgTypes };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
let joist_migration_utils = require("joist-migration-utils");
|
|
4
|
+
//#region src/pg-migrate.ts
|
|
5
|
+
if (typeof module !== "undefined" && require.main === module) {
|
|
6
|
+
if (Object.fromEntries === void 0) throw new Error("Joist requires Node v12.4.0+");
|
|
7
|
+
(0, joist_migration_utils.joistMigrate)().catch((err) => {
|
|
8
|
+
console.error(err);
|
|
9
|
+
process.exit(1);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
Object.keys(joist_migration_utils).forEach(function(k) {
|
|
14
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function() {
|
|
17
|
+
return joist_migration_utils[k];
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=pg-migrate.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pg-migrate.cjs","names":[],"sources":["../src/pg-migrate.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { joistMigrate } from \"joist-migration-utils\";\n\n// Re-export everything from joist-migration-utils\nexport * from \"joist-migration-utils\";\n\n// If we're being run locally.\nif (typeof module !== \"undefined\" && require.main === module) {\n if (Object.fromEntries === undefined) {\n throw new Error(\"Joist requires Node v12.4.0+\");\n }\n joistMigrate().catch((err) => {\n console.error(err);\n process.exit(1);\n });\n}\n"],"mappings":";;;;AAQA,IAAI,OAAO,WAAW,eAAe,QAAQ,SAAS,QAAQ;CAC5D,IAAI,OAAO,gBAAgB,KAAA,GACzB,MAAM,IAAI,MAAM,8BAA8B;CAEhD,CAAA,GAAA,sBAAA,aAAA,CAAa,CAAC,CAAC,OAAO,QAAQ;EAC5B,QAAQ,MAAM,GAAG;EACjB,QAAQ,KAAK,CAAC;CAChB,CAAC;AACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "joist-migration-utils";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "joist-migration-utils";
|
package/build/pg-migrate.js
CHANGED
|
@@ -1,31 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const joist_migration_utils_1 = require("joist-migration-utils");
|
|
19
|
-
// Re-export everything from joist-migration-utils
|
|
20
|
-
__exportStar(require("joist-migration-utils"), exports);
|
|
21
|
-
// If we're being run locally.
|
|
22
|
-
if (require.main === module) {
|
|
23
|
-
if (Object.fromEntries === undefined) {
|
|
24
|
-
throw new Error("Joist requires Node v12.4.0+");
|
|
25
|
-
}
|
|
26
|
-
(0, joist_migration_utils_1.joistMigrate)().catch((err) => {
|
|
27
|
-
console.error(err);
|
|
28
|
-
process.exit(1);
|
|
29
|
-
});
|
|
2
|
+
import { __require } from "./_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { joistMigrate } from "joist-migration-utils";
|
|
4
|
+
export * from "joist-migration-utils";
|
|
5
|
+
//#region src/pg-migrate.ts
|
|
6
|
+
if (typeof module !== "undefined" && __require.main === module) {
|
|
7
|
+
if (Object.fromEntries === void 0) throw new Error("Joist requires Node v12.4.0+");
|
|
8
|
+
joistMigrate().catch((err) => {
|
|
9
|
+
console.error(err);
|
|
10
|
+
process.exit(1);
|
|
11
|
+
});
|
|
30
12
|
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export {};
|
|
15
|
+
|
|
31
16
|
//# sourceMappingURL=pg-migrate.js.map
|
package/build/pg-migrate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pg-migrate.js","
|
|
1
|
+
{"version":3,"file":"pg-migrate.js","names":[],"sources":["../src/pg-migrate.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { joistMigrate } from \"joist-migration-utils\";\n\n// Re-export everything from joist-migration-utils\nexport * from \"joist-migration-utils\";\n\n// If we're being run locally.\nif (typeof module !== \"undefined\" && require.main === module) {\n if (Object.fromEntries === undefined) {\n throw new Error(\"Joist requires Node v12.4.0+\");\n }\n joistMigrate().catch((err) => {\n console.error(err);\n process.exit(1);\n });\n}\n"],"mappings":";;;;;AAQA,IAAI,OAAO,WAAW,eAAA,UAAuB,SAAS,QAAQ;CAC5D,IAAI,OAAO,gBAAgB,KAAA,GACzB,MAAM,IAAI,MAAM,8BAA8B;CAEhD,aAAa,CAAC,CAAC,OAAO,QAAQ;EAC5B,QAAQ,MAAM,GAAG;EACjB,QAAQ,KAAK,CAAC;CAChB,CAAC;AACH"}
|
package/build/seed.cjs
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_drivers_PostgresDriver = require("./drivers/PostgresDriver.cjs");
|
|
4
|
+
let joist_core = require("joist-core");
|
|
5
|
+
let pg = require("pg");
|
|
6
|
+
pg = require_runtime.__toESM(pg, 1);
|
|
7
|
+
//#region src/seed.ts
|
|
8
|
+
/**
|
|
9
|
+
* Seeds your local/test database with data created via the factories.
|
|
10
|
+
*
|
|
11
|
+
* Unlike `seed` from `joist-test-utils`, this defaults to the `PostgresDriver`, so you can just
|
|
12
|
+
* `import { seed } from "joist-orm/pg"` and pass only your seeding function.
|
|
13
|
+
*
|
|
14
|
+
* This will delete all data in the database, so is restricted to only `local` and `test`
|
|
15
|
+
* `NODE_ENV`s. We also assume the project does not require a context to seed.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { seed } from "joist-orm/pg";
|
|
20
|
+
*
|
|
21
|
+
* seed(async (em) => {
|
|
22
|
+
* // create your data via factories here
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
function seed(fn) {
|
|
27
|
+
const env = process.env.NODE_ENV;
|
|
28
|
+
if (env !== "local" && env !== "test") throw new Error("seed will only run with NODE_ENV=local or NODE_ENV=test because it resets the database");
|
|
29
|
+
const pool = new pg.default.Pool((0, joist_core.newPgConnectionConfig)());
|
|
30
|
+
run(pool, fn).then(async () => {
|
|
31
|
+
console.log("Seeded!");
|
|
32
|
+
await pool.end();
|
|
33
|
+
}).catch(async (err) => {
|
|
34
|
+
console.error(err);
|
|
35
|
+
await pool.end();
|
|
36
|
+
process.exit(1);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/** Flushes the database and runs `fn` against a fresh `EntityManager`. */
|
|
40
|
+
async function run(pool, fn) {
|
|
41
|
+
await pool.query("SELECT flush_database()");
|
|
42
|
+
const em = new joist_core.EntityManager({}, { driver: new require_drivers_PostgresDriver.PostgresDriver(pool) });
|
|
43
|
+
await fn(em);
|
|
44
|
+
await em.flush();
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
exports.seed = seed;
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=seed.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.cjs","names":["newPgConnectionConfig","EntityManager","PostgresDriver"],"sources":["../src/seed.ts"],"sourcesContent":["import { EntityManager, newPgConnectionConfig } from \"joist-core\";\nimport pg from \"pg\";\n\nimport { PostgresDriver } from \"./drivers/PostgresDriver.ts\";\n\n/**\n * Seeds your local/test database with data created via the factories.\n *\n * Unlike `seed` from `joist-test-utils`, this defaults to the `PostgresDriver`, so you can just\n * `import { seed } from \"joist-orm/pg\"` and pass only your seeding function.\n *\n * This will delete all data in the database, so is restricted to only `local` and `test`\n * `NODE_ENV`s. We also assume the project does not require a context to seed.\n *\n * @example\n * ```ts\n * import { seed } from \"joist-orm/pg\";\n *\n * seed(async (em) => {\n * // create your data via factories here\n * });\n * ```\n */\nexport function seed<E extends EntityManager = EntityManager>(fn: (em: E) => Promise<void>): void {\n const env = process.env.NODE_ENV;\n if (env !== \"local\" && env !== \"test\") {\n throw new Error(\"seed will only run with NODE_ENV=local or NODE_ENV=test because it resets the database\");\n }\n\n const pool = new pg.Pool(newPgConnectionConfig());\n\n run<E>(pool, fn)\n .then(async () => {\n console.log(\"Seeded!\");\n await pool.end();\n })\n .catch(async (err) => {\n console.error(err);\n await pool.end();\n process.exit(1);\n });\n}\n\n/** Flushes the database and runs `fn` against a fresh `EntityManager`. */\nasync function run<E extends EntityManager>(pool: pg.Pool, fn: (em: E) => Promise<void>): Promise<void> {\n await pool.query(\"SELECT flush_database()\");\n const em = new EntityManager({}, { driver: new PostgresDriver(pool) }) as E;\n await fn(em);\n await em.flush();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,KAA8C,IAAoC;CAChG,MAAM,MAAM,QAAQ,IAAI;CACxB,IAAI,QAAQ,WAAW,QAAQ,QAC7B,MAAM,IAAI,MAAM,wFAAwF;CAG1G,MAAM,OAAO,IAAI,GAAA,QAAG,MAAA,GAAKA,WAAAA,sBAAAA,CAAsB,CAAC;CAEhD,IAAO,MAAM,EAAE,CAAC,CACb,KAAK,YAAY;EAChB,QAAQ,IAAI,SAAS;EACrB,MAAM,KAAK,IAAI;CACjB,CAAC,CAAC,CACD,MAAM,OAAO,QAAQ;EACpB,QAAQ,MAAM,GAAG;EACjB,MAAM,KAAK,IAAI;EACf,QAAQ,KAAK,CAAC;CAChB,CAAC;AACL;;AAGA,eAAe,IAA6B,MAAe,IAA6C;CACtG,MAAM,KAAK,MAAM,yBAAyB;CAC1C,MAAM,KAAK,IAAIC,WAAAA,cAAc,CAAC,GAAG,EAAE,QAAQ,IAAIC,+BAAAA,eAAe,IAAI,EAAE,CAAC;CACrE,MAAM,GAAG,EAAE;CACX,MAAM,GAAG,MAAM;AACjB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EntityManager } from "joist-core";
|
|
2
|
+
//#region src/seed.d.ts
|
|
2
3
|
/**
|
|
3
4
|
* Seeds your local/test database with data created via the factories.
|
|
4
5
|
*
|
|
@@ -17,4 +18,7 @@ import { EntityManager } from "joist-core";
|
|
|
17
18
|
* });
|
|
18
19
|
* ```
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
|
+
declare function seed<E extends EntityManager = EntityManager>(fn: (em: E) => Promise<void>): void;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { seed };
|
|
24
|
+
//# sourceMappingURL=seed.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.d.cts","names":[],"sources":["../src/seed.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;iBAuBgB,KAAK,UAAU,gBAAgB,eAAe,KAAK,IAAI,MAAM"}
|
package/build/seed.d.mts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EntityManager } from "joist-core";
|
|
2
|
+
//#region src/seed.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Seeds your local/test database with data created via the factories.
|
|
5
|
+
*
|
|
6
|
+
* Unlike `seed` from `joist-test-utils`, this defaults to the `PostgresDriver`, so you can just
|
|
7
|
+
* `import { seed } from "joist-orm/pg"` and pass only your seeding function.
|
|
8
|
+
*
|
|
9
|
+
* This will delete all data in the database, so is restricted to only `local` and `test`
|
|
10
|
+
* `NODE_ENV`s. We also assume the project does not require a context to seed.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { seed } from "joist-orm/pg";
|
|
15
|
+
*
|
|
16
|
+
* seed(async (em) => {
|
|
17
|
+
* // create your data via factories here
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare function seed<E extends EntityManager = EntityManager>(fn: (em: E) => Promise<void>): void;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { seed };
|
|
24
|
+
//# sourceMappingURL=seed.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.d.mts","names":[],"sources":["../src/seed.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;iBAuBgB,KAAK,UAAU,gBAAgB,eAAe,KAAK,IAAI,MAAM"}
|
package/build/seed.js
CHANGED
|
@@ -1,52 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.seed = seed;
|
|
7
|
-
const joist_core_1 = require("joist-core");
|
|
8
|
-
const pg_1 = __importDefault(require("pg"));
|
|
9
|
-
const PostgresDriver_js_1 = require("./drivers/PostgresDriver.js");
|
|
1
|
+
import { PostgresDriver } from "./drivers/PostgresDriver.js";
|
|
2
|
+
import { EntityManager, newPgConnectionConfig } from "joist-core";
|
|
3
|
+
import pg from "pg";
|
|
4
|
+
//#region src/seed.ts
|
|
10
5
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
6
|
+
* Seeds your local/test database with data created via the factories.
|
|
7
|
+
*
|
|
8
|
+
* Unlike `seed` from `joist-test-utils`, this defaults to the `PostgresDriver`, so you can just
|
|
9
|
+
* `import { seed } from "joist-orm/pg"` and pass only your seeding function.
|
|
10
|
+
*
|
|
11
|
+
* This will delete all data in the database, so is restricted to only `local` and `test`
|
|
12
|
+
* `NODE_ENV`s. We also assume the project does not require a context to seed.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { seed } from "joist-orm/pg";
|
|
17
|
+
*
|
|
18
|
+
* seed(async (em) => {
|
|
19
|
+
* // create your data via factories here
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
28
23
|
function seed(fn) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
console.error(err);
|
|
41
|
-
await pool.end();
|
|
42
|
-
process.exit(1);
|
|
43
|
-
});
|
|
24
|
+
const env = process.env.NODE_ENV;
|
|
25
|
+
if (env !== "local" && env !== "test") throw new Error("seed will only run with NODE_ENV=local or NODE_ENV=test because it resets the database");
|
|
26
|
+
const pool = new pg.Pool(newPgConnectionConfig());
|
|
27
|
+
run(pool, fn).then(async () => {
|
|
28
|
+
console.log("Seeded!");
|
|
29
|
+
await pool.end();
|
|
30
|
+
}).catch(async (err) => {
|
|
31
|
+
console.error(err);
|
|
32
|
+
await pool.end();
|
|
33
|
+
process.exit(1);
|
|
34
|
+
});
|
|
44
35
|
}
|
|
45
36
|
/** Flushes the database and runs `fn` against a fresh `EntityManager`. */
|
|
46
37
|
async function run(pool, fn) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
38
|
+
await pool.query("SELECT flush_database()");
|
|
39
|
+
const em = new EntityManager({}, { driver: new PostgresDriver(pool) });
|
|
40
|
+
await fn(em);
|
|
41
|
+
await em.flush();
|
|
51
42
|
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { seed };
|
|
45
|
+
|
|
52
46
|
//# sourceMappingURL=seed.js.map
|
package/build/seed.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed.js","
|
|
1
|
+
{"version":3,"file":"seed.js","names":[],"sources":["../src/seed.ts"],"sourcesContent":["import { EntityManager, newPgConnectionConfig } from \"joist-core\";\nimport pg from \"pg\";\n\nimport { PostgresDriver } from \"./drivers/PostgresDriver.ts\";\n\n/**\n * Seeds your local/test database with data created via the factories.\n *\n * Unlike `seed` from `joist-test-utils`, this defaults to the `PostgresDriver`, so you can just\n * `import { seed } from \"joist-orm/pg\"` and pass only your seeding function.\n *\n * This will delete all data in the database, so is restricted to only `local` and `test`\n * `NODE_ENV`s. We also assume the project does not require a context to seed.\n *\n * @example\n * ```ts\n * import { seed } from \"joist-orm/pg\";\n *\n * seed(async (em) => {\n * // create your data via factories here\n * });\n * ```\n */\nexport function seed<E extends EntityManager = EntityManager>(fn: (em: E) => Promise<void>): void {\n const env = process.env.NODE_ENV;\n if (env !== \"local\" && env !== \"test\") {\n throw new Error(\"seed will only run with NODE_ENV=local or NODE_ENV=test because it resets the database\");\n }\n\n const pool = new pg.Pool(newPgConnectionConfig());\n\n run<E>(pool, fn)\n .then(async () => {\n console.log(\"Seeded!\");\n await pool.end();\n })\n .catch(async (err) => {\n console.error(err);\n await pool.end();\n process.exit(1);\n });\n}\n\n/** Flushes the database and runs `fn` against a fresh `EntityManager`. */\nasync function run<E extends EntityManager>(pool: pg.Pool, fn: (em: E) => Promise<void>): Promise<void> {\n await pool.query(\"SELECT flush_database()\");\n const em = new EntityManager({}, { driver: new PostgresDriver(pool) }) as E;\n await fn(em);\n await em.flush();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,KAA8C,IAAoC;CAChG,MAAM,MAAM,QAAQ,IAAI;CACxB,IAAI,QAAQ,WAAW,QAAQ,QAC7B,MAAM,IAAI,MAAM,wFAAwF;CAG1G,MAAM,OAAO,IAAI,GAAG,KAAK,sBAAsB,CAAC;CAEhD,IAAO,MAAM,EAAE,CAAC,CACb,KAAK,YAAY;EAChB,QAAQ,IAAI,SAAS;EACrB,MAAM,KAAK,IAAI;CACjB,CAAC,CAAC,CACD,MAAM,OAAO,QAAQ;EACpB,QAAQ,MAAM,GAAG;EACjB,MAAM,KAAK,IAAI;EACf,QAAQ,KAAK,CAAC;CAChB,CAAC;AACL;;AAGA,eAAe,IAA6B,MAAe,IAA6C;CACtG,MAAM,KAAK,MAAM,yBAAyB;CAC1C,MAAM,KAAK,IAAI,cAAc,CAAC,GAAG,EAAE,QAAQ,IAAI,eAAe,IAAI,EAAE,CAAC;CACrE,MAAM,GAAG,EAAE;CACX,MAAM,GAAG,MAAM;AACjB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
var joist_test_utils = require("joist-test-utils");
|
|
3
|
+
Object.keys(joist_test_utils).forEach(function(k) {
|
|
4
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
get: function() {
|
|
7
|
+
return joist_test_utils[k];
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "joist-test-utils";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "joist-test-utils";
|
package/build/tests-export.js
CHANGED
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
// Re-export everything from joist-test-utils
|
|
18
|
-
__exportStar(require("joist-test-utils"), exports);
|
|
19
|
-
//# sourceMappingURL=tests-export.js.map
|
|
1
|
+
export * from "joist-test-utils";
|
|
2
|
+
export {};
|