@payloadcms/db-postgres 0.8.7 → 0.8.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. package/dist/connect.d.ts.map +1 -1
  2. package/dist/connect.js +5 -52
  3. package/dist/count.d.ts.map +1 -1
  4. package/dist/count.js +3 -3
  5. package/dist/createMigration.d.ts.map +1 -1
  6. package/dist/createMigration.js +10 -4
  7. package/dist/find/findMany.d.ts.map +1 -1
  8. package/dist/find/findMany.js +3 -3
  9. package/dist/init.js +3 -2
  10. package/dist/migrate.js +3 -3
  11. package/dist/migrateDown.js +2 -2
  12. package/dist/migrateRefresh.js +2 -2
  13. package/dist/migrateReset.js +3 -3
  14. package/dist/migrateStatus.js +2 -2
  15. package/dist/queries/parseParams.d.ts.map +1 -1
  16. package/dist/queries/parseParams.js +3 -1
  17. package/dist/queries/sanitizeQueryValue.d.ts +2 -1
  18. package/dist/queries/sanitizeQueryValue.d.ts.map +1 -1
  19. package/dist/queries/sanitizeQueryValue.js +11 -2
  20. package/dist/schema/build.d.ts +10 -2
  21. package/dist/schema/build.d.ts.map +1 -1
  22. package/dist/schema/build.js +23 -6
  23. package/dist/schema/traverseFields.d.ts +6 -1
  24. package/dist/schema/traverseFields.d.ts.map +1 -1
  25. package/dist/schema/traverseFields.js +46 -17
  26. package/dist/transform/read/hasManyNumber.d.ts +2 -1
  27. package/dist/transform/read/hasManyNumber.d.ts.map +1 -1
  28. package/dist/transform/read/hasManyNumber.js +14 -4
  29. package/dist/transform/read/hasManyText.d.ts +2 -1
  30. package/dist/transform/read/hasManyText.d.ts.map +1 -1
  31. package/dist/transform/read/hasManyText.js +14 -4
  32. package/dist/transform/read/relationship.d.ts +2 -1
  33. package/dist/transform/read/relationship.d.ts.map +1 -1
  34. package/dist/transform/read/relationship.js +16 -7
  35. package/dist/transform/read/traverseFields.d.ts +5 -1
  36. package/dist/transform/read/traverseFields.d.ts.map +1 -1
  37. package/dist/transform/read/traverseFields.js +118 -85
  38. package/dist/transform/write/array.d.ts +6 -1
  39. package/dist/transform/write/array.d.ts.map +1 -1
  40. package/dist/transform/write/array.js +7 -3
  41. package/dist/transform/write/blocks.d.ts +6 -1
  42. package/dist/transform/write/blocks.d.ts.map +1 -1
  43. package/dist/transform/write/blocks.js +5 -3
  44. package/dist/transform/write/traverseFields.d.ts +6 -1
  45. package/dist/transform/write/traverseFields.d.ts.map +1 -1
  46. package/dist/transform/write/traverseFields.js +40 -15
  47. package/dist/types.d.ts +9 -5
  48. package/dist/types.d.ts.map +1 -1
  49. package/dist/utilities/migrationTableExists.d.ts +2 -2
  50. package/dist/utilities/migrationTableExists.d.ts.map +1 -1
  51. package/dist/utilities/migrationTableExists.js +10 -6
  52. package/dist/utilities/pushDevSchema.d.ts +9 -0
  53. package/dist/utilities/pushDevSchema.d.ts.map +1 -0
  54. package/dist/utilities/pushDevSchema.js +59 -0
  55. package/dist/utilities/requireDrizzleKit.d.ts +14 -0
  56. package/dist/utilities/requireDrizzleKit.d.ts.map +1 -0
  57. package/dist/utilities/requireDrizzleKit.js +13 -0
  58. package/package.json +5 -5
@@ -9,11 +9,15 @@ Object.defineProperty(exports, "migrationTableExists", {
9
9
  }
10
10
  });
11
11
  const _drizzleorm = require("drizzle-orm");
12
- const migrationTableExists = async (db)=>{
13
- const queryRes = await db.execute((0, _drizzleorm.sql)`SELECT to_regclass('public.payload_migrations');`);
14
- // Returns table name 'payload_migrations' or null
15
- const exists = queryRes.rows?.[0]?.to_regclass === 'payload_migrations';
16
- return exists;
12
+ const migrationTableExists = async (adapter)=>{
13
+ let statement;
14
+ if (adapter.name === 'postgres') {
15
+ const prependSchema = adapter.schemaName ? `"${adapter.schemaName}".` : '';
16
+ statement = `SELECT to_regclass('${prependSchema}"payload_migrations"') AS exists;`;
17
+ }
18
+ const result = await adapter.drizzle.execute(_drizzleorm.sql.raw(statement));
19
+ const [row] = result.rows;
20
+ return row && typeof row === 'object' && 'exists' in row && !!row.exists;
17
21
  };
18
22
 
19
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJ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ZXIiLCJzdGF0ZW1lbnQiLCJuYW1lIiwicHJlcGVuZFNjaGVtYSIsInNjaGVtYU5hbWUiLCJyZXN1bHQiLCJkcml6emxlIiwiZXhlY3V0ZSIsInNxbCIsInJhdyIsInJvdyIsInJvd3MiLCJleGlzdHMiXSwicmFuZ2VNYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7IiwibWFwcGluZ3MiOiI7Ozs7K0JBSWFBOzs7ZUFBQUE7Ozs0QkFKTztBQUliLE1BQU1BLHVCQUF1QixPQUFPQztJQUN6QyxJQUFJQztJQUVKLElBQUlELFFBQVFFLElBQUksS0FBSyxZQUFZO1FBQy9CLE1BQU1DLGdCQUFnQkgsUUFBUUksVUFBVSxHQUFHLENBQUMsQ0FBQyxFQUFFSixRQUFRSSxVQUFVLENBQUMsRUFBRSxDQUFDLEdBQUc7UUFDeEVILFlBQVksQ0FBQyxvQkFBb0IsRUFBRUUsY0FBYyxpQ0FBaUMsQ0FBQztJQUNyRjtJQUVBLE1BQU1FLFNBQVMsTUFBTUwsUUFBUU0sT0FBTyxDQUFDQyxPQUFPLENBQUNDLGVBQUcsQ0FBQ0MsR0FBRyxDQUFDUjtJQUVyRCxNQUFNLENBQUNTLElBQUksR0FBR0wsT0FBT00sSUFBSTtJQUV6QixPQUFPRCxPQUFPLE9BQU9BLFFBQVEsWUFBWSxZQUFZQSxPQUFPLENBQUMsQ0FBQ0EsSUFBSUUsTUFBTTtBQUMxRSJ9
@@ -0,0 +1,9 @@
1
+ import type { PostgresAdapter } from '../types.js';
2
+ /**
3
+ * Pushes the development schema to the database using Drizzle.
4
+ *
5
+ * @param {PostgresAdapter} adapter - The PostgresAdapter instance connected to the database.
6
+ * @returns {Promise<void>} - A promise that resolves once the schema push is complete.
7
+ */
8
+ export declare const pushDevSchema: (adapter: PostgresAdapter) => Promise<void>;
9
+ //# sourceMappingURL=pushDevSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pushDevSchema.d.ts","sourceRoot":"","sources":["../../src/utilities/pushDevSchema.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAIlD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,YAAmB,eAAe,kBA8D3D,CAAA"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "pushDevSchema", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return pushDevSchema;
9
+ }
10
+ });
11
+ const _drizzleorm = require("drizzle-orm");
12
+ const _prompts = /*#__PURE__*/ _interop_require_default(require("prompts"));
13
+ const _requireDrizzleKit = require("./requireDrizzleKit");
14
+ function _interop_require_default(obj) {
15
+ return obj && obj.__esModule ? obj : {
16
+ default: obj
17
+ };
18
+ }
19
+ const pushDevSchema = async (adapter)=>{
20
+ const { pushSchema } = (0, _requireDrizzleKit.requireDrizzleKit)();
21
+ // This will prompt if clarifications are needed for Drizzle to push new schema
22
+ const { apply, hasDataLoss, warnings } = await pushSchema(adapter.schema, adapter.drizzle, adapter.schemaName ? [
23
+ adapter.schemaName
24
+ ] : undefined);
25
+ if (warnings.length) {
26
+ let message = `Warnings detected during schema push: \n\n${warnings.join('\n')}\n\n`;
27
+ if (hasDataLoss) {
28
+ message += `DATA LOSS WARNING: Possible data loss detected if schema is pushed.\n\n`;
29
+ }
30
+ message += `Accept warnings and push schema to database?`;
31
+ const { confirm: acceptWarnings } = await (0, _prompts.default)({
32
+ name: 'confirm',
33
+ type: 'confirm',
34
+ initial: false,
35
+ message
36
+ }, {
37
+ onCancel: ()=>{
38
+ process.exit(0);
39
+ }
40
+ });
41
+ // Exit if user does not accept warnings.
42
+ // Q: Is this the right type of exit for this interaction?
43
+ if (!acceptWarnings) {
44
+ process.exit(0);
45
+ }
46
+ }
47
+ await apply();
48
+ const migrationsTable = adapter.schemaName ? `"${adapter.schemaName}"."payload_migrations"` : '"payload_migrations"';
49
+ const { drizzle } = adapter;
50
+ const result = await drizzle.execute(_drizzleorm.sql.raw(`SELECT * FROM ${migrationsTable} WHERE batch = '-1'`));
51
+ const devPush = result.rows;
52
+ if (!devPush.length) {
53
+ await drizzle.execute(_drizzleorm.sql.raw(`INSERT INTO ${migrationsTable} (name, batch) VALUES ('dev', '-1')`));
54
+ } else {
55
+ await drizzle.execute(_drizzleorm.sql.raw(`UPDATE ${migrationsTable} SET updated_at = CURRENT_TIMESTAMP WHERE batch = '-1'`));
56
+ }
57
+ };
58
+
59
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvcHVzaERldlNjaGVtYS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBzcWwgfSBmcm9tICdkcml6emxlLW9ybSdcbmltcG9ydCBwcm9tcHRzIGZyb20gJ3Byb21wdHMnXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi4vdHlwZXMuanMnXG5cbmltcG9ydCB7IHJlcXVpcmVEcml6emxlS2l0IH0gZnJvbSAnLi9yZXF1aXJlRHJpenpsZUtpdCdcblxuLyoqXG4gKiBQdXNoZXMgdGhlIGRldmVsb3BtZW50IHNjaGVtYSB0byB0aGUgZGF0YWJhc2UgdXNpbmcgRHJpenpsZS5cbiAqXG4gKiBAcGFyYW0ge1Bvc3RncmVzQWRhcHRlcn0gYWRhcHRlciAtIFRoZSBQb3N0Z3Jlc0FkYXB0ZXIgaW5zdGFuY2UgY29ubmVjdGVkIHRvIHRoZSBkYXRhYmFzZS5cbiAqIEByZXR1cm5zIHtQcm9taXNlPHZvaWQ+fSAtIEEgcHJvbWlzZSB0aGF0IHJlc29sdmVzIG9uY2UgdGhlIHNjaGVtYSBwdXNoIGlzIGNvbXBsZXRlLlxuICovXG5leHBvcnQgY29uc3QgcHVzaERldlNjaGVtYSA9IGF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LENBQUMsQ0FBQyxZQUFZLEVBQUVKLGdCQUFnQixtQ0FBbUMsQ0FBQztJQUUvRSxPQUFPO1FBQ0wsTUFBTWYsUUFBUWlCLE9BQU8sQ0FDbkJDLGVBQUcsQ0FBQ0MsR0FBRyxDQUFDLENBQUMsT0FBTyxFQUFFSixnQkFBZ0Isc0RBQXNELENBQUM7SUFFN0Y7QUFDRiJ9
@@ -0,0 +1,14 @@
1
+ import type { PostgresAdapter } from '../types';
2
+ type RequireDrizzleKit = () => {
3
+ generateDrizzleJson: (args: {
4
+ schema: Record<string, unknown>;
5
+ }) => unknown;
6
+ pushSchema: (schema: Record<string, unknown>, drizzle: PostgresAdapter['drizzle'], filterSchema?: string[]) => Promise<{
7
+ apply: any;
8
+ hasDataLoss: any;
9
+ warnings: any;
10
+ }>;
11
+ };
12
+ export declare const requireDrizzleKit: RequireDrizzleKit;
13
+ export {};
14
+ //# sourceMappingURL=requireDrizzleKit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requireDrizzleKit.d.ts","sourceRoot":"","sources":["../../src/utilities/requireDrizzleKit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,KAAK,iBAAiB,GAAG,MAAM;IAC7B,mBAAmB,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,KAAK,OAAO,CAAA;IAC3E,UAAU,EAAE,CACV,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,EACnC,YAAY,CAAC,EAAE,MAAM,EAAE,KACpB,OAAO,CAAC;QAAE,KAAK,MAAC;QAAC,WAAW,MAAC;QAAC,QAAQ,MAAA;KAAE,CAAC,CAAA;CAC/C,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,iBAAoD,CAAA"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "requireDrizzleKit", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return requireDrizzleKit;
9
+ }
10
+ });
11
+ const requireDrizzleKit = ()=>require('drizzle-kit/api');
12
+
13
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvcmVxdWlyZURyaXp6bGVLaXQudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBQb3N0Z3Jlc0FkYXB0ZXIgfSBmcm9tICcuLi90eXBlcydcblxudHlwZSBSZXF1aXJlRHJpenpsZUtpdCA9ICgpID0+IHtcbiAgZ2VuZXJhdGVEcml6emxlSnNvbjogKGFyZ3M6IHsgc2NoZW1hOiBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPiB9KSA9PiB1bmtub3duXG4gIHB1c2hTY2hlbWE6IChcbiAgICBzY2hlbWE6IFJlY29yZDxzdHJpbmcsIHVua25vd24+LFxuICAgIGRyaXp6bGU6IFBvc3RncmVzQWRhcHRlclsnZHJpenpsZSddLFxuICAgIGZpbHRlclNjaGVtYT86IHN0cmluZ1tdLFxuICApID0+IFByb21pc2U8eyBhcHBseTsgaGFzRGF0YUxvc3M7IHdhcm5pbmdzIH0+XG59XG5cbmV4cG9ydCBjb25zdCByZXF1aXJlRHJpenpsZUtpdDogUmVxdWlyZURyaXp6bGVLaXQgPSAoKSA9PiByZXF1aXJlKCdkcml6emxlLWtpdC9hcGknKVxuIl0sIm5hbWVzIjpbInJlcXVpcmVEcml6emxlS2l0IiwicmVxdWlyZSJdLCJyYW5nZU1hcHBpbmdzIjoiOzs7Ozs7Ozs7OyIsIm1hcHBpbmdzIjoiOzs7OytCQVdhQTs7O2VBQUFBOzs7QUFBTixNQUFNQSxvQkFBdUMsSUFBTUMsUUFBUSJ9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/db-postgres",
3
- "version": "0.8.7",
3
+ "version": "0.8.8",
4
4
  "description": "The officially supported Postgres database adapter for Payload",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,18 +19,18 @@
19
19
  "dependencies": {
20
20
  "@libsql/client": "^0.3.1",
21
21
  "console-table-printer": "2.11.2",
22
- "drizzle-kit": "0.20.14-1f2c838",
23
- "drizzle-orm": "0.29.3",
22
+ "drizzle-kit": "0.23.2-df9e596",
23
+ "drizzle-orm": "0.32.1",
24
24
  "pg": "8.11.3",
25
25
  "prompts": "2.4.2",
26
26
  "to-snake-case": "1.0.0",
27
- "uuid": "9.0.0"
27
+ "uuid": "10.0.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/pg": "8.10.2",
31
31
  "@types/to-snake-case": "1.0.0",
32
32
  "@payloadcms/eslint-config": "1.1.1",
33
- "payload": "2.29.0"
33
+ "payload": "2.30.2"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "payload": "^2.0.0"