@payloadcms/db-postgres 3.0.0-alpha.41 → 3.0.0-alpha.43

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. package/dist/connect.js +1 -1
  2. package/dist/connect.js.map +1 -0
  3. package/dist/create.js +1 -1
  4. package/dist/create.js.map +1 -0
  5. package/dist/createGlobal.js +1 -1
  6. package/dist/createGlobal.js.map +1 -0
  7. package/dist/createGlobalVersion.js +1 -1
  8. package/dist/createGlobalVersion.js.map +1 -0
  9. package/dist/createMigration.d.ts.map +1 -1
  10. package/dist/createMigration.js +4 -2
  11. package/dist/createMigration.js.map +1 -0
  12. package/dist/createVersion.js +1 -1
  13. package/dist/createVersion.js.map +1 -0
  14. package/dist/deleteMany.js +1 -1
  15. package/dist/deleteMany.js.map +1 -0
  16. package/dist/deleteOne.js +1 -1
  17. package/dist/deleteOne.js.map +1 -0
  18. package/dist/deleteVersions.js +1 -1
  19. package/dist/deleteVersions.js.map +1 -0
  20. package/dist/destroy.js +1 -1
  21. package/dist/destroy.js.map +1 -0
  22. package/dist/find/buildFindManyArgs.js +1 -1
  23. package/dist/find/buildFindManyArgs.js.map +1 -0
  24. package/dist/find/chainMethods.js +1 -1
  25. package/dist/find/chainMethods.js.map +1 -0
  26. package/dist/find/findMany.js +1 -1
  27. package/dist/find/findMany.js.map +1 -0
  28. package/dist/find/traverseFields.js +1 -1
  29. package/dist/find/traverseFields.js.map +1 -0
  30. package/dist/find.js +1 -1
  31. package/dist/find.js.map +1 -0
  32. package/dist/findGlobal.js +1 -1
  33. package/dist/findGlobal.js.map +1 -0
  34. package/dist/findGlobalVersions.js +1 -1
  35. package/dist/findGlobalVersions.js.map +1 -0
  36. package/dist/findOne.js +1 -1
  37. package/dist/findOne.js.map +1 -0
  38. package/dist/findVersions.js +1 -1
  39. package/dist/findVersions.js.map +1 -0
  40. package/dist/index.js +1 -1
  41. package/dist/index.js.map +1 -0
  42. package/dist/init.js +1 -1
  43. package/dist/init.js.map +1 -0
  44. package/dist/migrate.d.ts.map +1 -1
  45. package/dist/migrate.js +5 -3
  46. package/dist/migrate.js.map +1 -0
  47. package/dist/migrateDown.js +1 -1
  48. package/dist/migrateDown.js.map +1 -0
  49. package/dist/migrateFresh.js +1 -1
  50. package/dist/migrateFresh.js.map +1 -0
  51. package/dist/migrateRefresh.js +1 -1
  52. package/dist/migrateRefresh.js.map +1 -0
  53. package/dist/migrateReset.js +1 -1
  54. package/dist/migrateReset.js.map +1 -0
  55. package/dist/migrateStatus.js +1 -1
  56. package/dist/migrateStatus.js.map +1 -0
  57. package/dist/queries/buildAndOrConditions.js +1 -1
  58. package/dist/queries/buildAndOrConditions.js.map +1 -0
  59. package/dist/queries/buildQuery.js +1 -1
  60. package/dist/queries/buildQuery.js.map +1 -0
  61. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.js +1 -1
  62. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.js.map +1 -0
  63. package/dist/queries/createJSONQuery/formatJSONPathSegment.js +1 -1
  64. package/dist/queries/createJSONQuery/formatJSONPathSegment.js.map +1 -0
  65. package/dist/queries/createJSONQuery/index.js +1 -1
  66. package/dist/queries/createJSONQuery/index.js.map +1 -0
  67. package/dist/queries/getTableColumnFromPath.js +1 -1
  68. package/dist/queries/getTableColumnFromPath.js.map +1 -0
  69. package/dist/queries/operatorMap.js +1 -1
  70. package/dist/queries/operatorMap.js.map +1 -0
  71. package/dist/queries/parseParams.js +1 -1
  72. package/dist/queries/parseParams.js.map +1 -0
  73. package/dist/queries/sanitizeQueryValue.js +1 -1
  74. package/dist/queries/sanitizeQueryValue.js.map +1 -0
  75. package/dist/queryDrafts.js +1 -1
  76. package/dist/queryDrafts.js.map +1 -0
  77. package/dist/schema/build.js +1 -1
  78. package/dist/schema/build.js.map +1 -0
  79. package/dist/schema/createIndex.js +1 -1
  80. package/dist/schema/createIndex.js.map +1 -0
  81. package/dist/schema/idToUUID.js +1 -1
  82. package/dist/schema/idToUUID.js.map +1 -0
  83. package/dist/schema/parentIDColumnMap.js +1 -1
  84. package/dist/schema/parentIDColumnMap.js.map +1 -0
  85. package/dist/schema/setColumnID.js +1 -1
  86. package/dist/schema/setColumnID.js.map +1 -0
  87. package/dist/schema/traverseFields.js +1 -1
  88. package/dist/schema/traverseFields.js.map +1 -0
  89. package/dist/schema/validateExistingBlockIsIdentical.js +1 -1
  90. package/dist/schema/validateExistingBlockIsIdentical.js.map +1 -0
  91. package/dist/transactions/beginTransaction.js +1 -1
  92. package/dist/transactions/beginTransaction.js.map +1 -0
  93. package/dist/transactions/commitTransaction.js +1 -1
  94. package/dist/transactions/commitTransaction.js.map +1 -0
  95. package/dist/transactions/rollbackTransaction.js +1 -1
  96. package/dist/transactions/rollbackTransaction.js.map +1 -0
  97. package/dist/transform/read/hasManyNumber.js +1 -1
  98. package/dist/transform/read/hasManyNumber.js.map +1 -0
  99. package/dist/transform/read/hasManyText.js +1 -1
  100. package/dist/transform/read/hasManyText.js.map +1 -0
  101. package/dist/transform/read/index.js +1 -1
  102. package/dist/transform/read/index.js.map +1 -0
  103. package/dist/transform/read/relationship.js +1 -1
  104. package/dist/transform/read/relationship.js.map +1 -0
  105. package/dist/transform/read/traverseFields.js +1 -1
  106. package/dist/transform/read/traverseFields.js.map +1 -0
  107. package/dist/transform/write/array.js +1 -1
  108. package/dist/transform/write/array.js.map +1 -0
  109. package/dist/transform/write/blocks.js +1 -1
  110. package/dist/transform/write/blocks.js.map +1 -0
  111. package/dist/transform/write/index.js +1 -1
  112. package/dist/transform/write/index.js.map +1 -0
  113. package/dist/transform/write/numbers.js +1 -1
  114. package/dist/transform/write/numbers.js.map +1 -0
  115. package/dist/transform/write/relationships.js +1 -1
  116. package/dist/transform/write/relationships.js.map +1 -0
  117. package/dist/transform/write/selects.js +1 -1
  118. package/dist/transform/write/selects.js.map +1 -0
  119. package/dist/transform/write/texts.js +1 -1
  120. package/dist/transform/write/texts.js.map +1 -0
  121. package/dist/transform/write/traverseFields.js +1 -1
  122. package/dist/transform/write/traverseFields.js.map +1 -0
  123. package/dist/transform/write/types.js +1 -1
  124. package/dist/transform/write/types.js.map +1 -0
  125. package/dist/types.js +1 -1
  126. package/dist/types.js.map +1 -0
  127. package/dist/update.js +1 -1
  128. package/dist/update.js.map +1 -0
  129. package/dist/updateGlobal.js +1 -1
  130. package/dist/updateGlobal.js.map +1 -0
  131. package/dist/updateGlobalVersion.js +1 -1
  132. package/dist/updateGlobalVersion.js.map +1 -0
  133. package/dist/updateVersion.js +1 -1
  134. package/dist/updateVersion.js.map +1 -0
  135. package/dist/upsertRow/deleteExistingArrayRows.js +1 -1
  136. package/dist/upsertRow/deleteExistingArrayRows.js.map +1 -0
  137. package/dist/upsertRow/deleteExistingRowsByPath.js +1 -1
  138. package/dist/upsertRow/deleteExistingRowsByPath.js.map +1 -0
  139. package/dist/upsertRow/index.js +1 -1
  140. package/dist/upsertRow/index.js.map +1 -0
  141. package/dist/upsertRow/insertArrays.js +1 -1
  142. package/dist/upsertRow/insertArrays.js.map +1 -0
  143. package/dist/upsertRow/types.js +1 -1
  144. package/dist/upsertRow/types.js.map +1 -0
  145. package/dist/utilities/appendPrefixToKeys.js +1 -1
  146. package/dist/utilities/appendPrefixToKeys.js.map +1 -0
  147. package/dist/utilities/createBlocksMap.js +1 -1
  148. package/dist/utilities/createBlocksMap.js.map +1 -0
  149. package/dist/utilities/createMigrationTable.js +1 -1
  150. package/dist/utilities/createMigrationTable.js.map +1 -0
  151. package/dist/utilities/createRelationshipMap.js +1 -1
  152. package/dist/utilities/createRelationshipMap.js.map +1 -0
  153. package/dist/utilities/hasLocalesTable.js +1 -1
  154. package/dist/utilities/hasLocalesTable.js.map +1 -0
  155. package/dist/utilities/isArrayOfRows.js +1 -1
  156. package/dist/utilities/isArrayOfRows.js.map +1 -0
  157. package/dist/utilities/migrationTableExists.js +1 -1
  158. package/dist/utilities/migrationTableExists.js.map +1 -0
  159. package/dist/utilities/parseError.js +1 -1
  160. package/dist/utilities/parseError.js.map +1 -0
  161. package/dist/utilities/pushDevSchema.d.ts.map +1 -1
  162. package/dist/utilities/pushDevSchema.js +4 -2
  163. package/dist/utilities/pushDevSchema.js.map +1 -0
  164. package/package.json +3 -3
@@ -1,7 +1,9 @@
1
1
  import { eq } from 'drizzle-orm';
2
2
  import { numeric, timestamp, varchar } from 'drizzle-orm/pg-core';
3
+ import { createRequire } from 'module';
3
4
  import prompts from 'prompts';
4
- const { pushSchema } = await import('drizzle-kit/payload');
5
+ const require = createRequire(import.meta.url);
6
+ const { pushSchema } = require('drizzle-kit/payload');
5
7
  /**
6
8
  * Pushes the development schema to the database using Drizzle.
7
9
  *
@@ -53,4 +55,4 @@ const { pushSchema } = await import('drizzle-kit/payload');
53
55
  }
54
56
  };
55
57
 
56
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvcHVzaERldlNjaGVtYS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBlcSB9IGZyb20gJ2RyaXp6bGUtb3JtJ1xuaW1wb3J0IHsgbnVtZXJpYywgdGltZXN0YW1wLCB2YXJjaGFyIH0gZnJvbSAnZHJpenpsZS1vcm0vcGctY29yZSdcbmltcG9ydCBwcm9tcHRzIGZyb20gJ3Byb21wdHMnXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi4vdHlwZXMuanMnXG5cbmNvbnN0IHsgcHVzaFNjaGVtYSB9ID0gYXdhaXQgaW1wb3J0KCdkcml6emxlLWtpdC9wYXlsb2FkJylcblxuLyoqXG4gKiBQdXNoZXMgdGhlIGRldmVsb3BtZW50IHNjaGVtYSB0byB0aGUgZGF0YWJhc2UgdXNpbmcgRHJpenpsZS5cbiAqXG4gKiBAcGFyYW0ge1Bvc3RncmVzQWRhcHRlcn0gZGIgLSBUaGUgUG9zdGdyZXNBZGFwdGVyIGluc3RhbmNlIGNvbm5lY3RlZCB0byB0aGUgZGF0YWJhc2UuXG4gK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qm1CLE1BQU0sR0FDTkMsSUFBSSxDQUFDUixrQkFDTFMsS0FBSyxDQUFDbEMsR0FBR3lCLGlCQUFpQkcsS0FBSyxFQUFFO0lBRXBDLElBQUksQ0FBQ0csUUFBUWpCLE1BQU0sRUFBRTtRQUNuQixNQUFNUCxHQUFHTSxPQUFPLENBQUNzQixNQUFNLENBQUNWLGtCQUFrQlcsTUFBTSxDQUFDO1lBQy9DakIsTUFBTTtZQUNOUyxPQUFPO1FBQ1Q7SUFDRixPQUFPO1FBQ0wsTUFBTXJCLEdBQUdNLE9BQU8sQ0FDYndCLE1BQU0sQ0FBQ1osa0JBQ1BhLEdBQUcsQ0FBQztZQUNIUixZQUFZLElBQUlTO1FBQ2xCLEdBQ0NMLEtBQUssQ0FBQ2xDLEdBQUd5QixpQkFBaUJHLEtBQUssRUFBRTtJQUN0QztBQUNGLEVBQUMifQ==
58
+ //# sourceMappingURL=pushDevSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utilities/pushDevSchema.ts"],"sourcesContent":["import { eq } from 'drizzle-orm'\nimport { numeric, timestamp, varchar } from 'drizzle-orm/pg-core'\nimport { createRequire } from 'module'\nimport prompts from 'prompts'\n\nimport type { PostgresAdapter } from '../types.js'\n\nconst require = createRequire(import.meta.url)\n\nconst { pushSchema } = require('drizzle-kit/payload')\n\n/**\n * Pushes the development schema to the database using Drizzle.\n *\n * @param {PostgresAdapter} db - The PostgresAdapter instance connected to the database.\n * @returns {Promise<void>} - A promise that resolves once the schema push is complete.\n */\nexport const pushDevSchema = async (db: PostgresAdapter) => {\n // This will prompt if clarifications are needed for Drizzle to push new schema\n const { apply, hasDataLoss, statementsToExecute, warnings } = await pushSchema(\n db.schema,\n db.drizzle,\n )\n\n if (warnings.length) {\n let message = `Warnings detected during schema push: \\n\\n${warnings.join('\\n')}\\n\\n`\n\n if (hasDataLoss) {\n message += `DATA LOSS WARNING: Possible data loss detected if schema is pushed.\\n\\n`\n }\n\n message += `Accept warnings and push schema to database?`\n\n const { confirm: acceptWarnings } = await prompts(\n {\n name: 'confirm',\n type: 'confirm',\n initial: false,\n message,\n },\n {\n onCancel: () => {\n process.exit(0)\n },\n },\n )\n\n // Exit if user does not accept warnings.\n // Q: Is this the right type of exit for this interaction?\n if (!acceptWarnings) {\n process.exit(0)\n }\n }\n\n await apply()\n\n // Migration table def in order to use query using drizzle\n const migrationsSchema = db.pgSchema.table('payload_migrations', {\n name: varchar('name'),\n batch: numeric('batch'),\n created_at: timestamp('created_at'),\n updated_at: timestamp('updated_at'),\n })\n\n const devPush = await db.drizzle\n .select()\n .from(migrationsSchema)\n .where(eq(migrationsSchema.batch, '-1'))\n\n if (!devPush.length) {\n await db.drizzle.insert(migrationsSchema).values({\n name: 'dev',\n batch: '-1',\n })\n } else {\n await db.drizzle\n .update(migrationsSchema)\n .set({\n updated_at: new Date(),\n })\n .where(eq(migrationsSchema.batch, '-1'))\n }\n}\n"],"names":["eq","numeric","timestamp","varchar","createRequire","prompts","require","url","pushSchema","pushDevSchema","db","apply","hasDataLoss","statementsToExecute","warnings","schema","drizzle","length","message","join","confirm","acceptWarnings","name","type","initial","onCancel","process","exit","migrationsSchema","pgSchema","table","batch","created_at","updated_at","devPush","select","from","where","insert","values","update","set","Date"],"mappings":"AAAA,SAASA,EAAE,QAAQ,cAAa;AAChC,SAASC,OAAO,EAAEC,SAAS,EAAEC,OAAO,QAAQ,sBAAqB;AACjE,SAASC,aAAa,QAAQ,SAAQ;AACtC,OAAOC,aAAa,UAAS;AAI7B,MAAMC,UAAUF,cAAc,YAAYG,GAAG;AAE7C,MAAM,EAAEC,UAAU,EAAE,GAAGF,QAAQ;AAE/B;;;;;CAKC,GACD,OAAO,MAAMG,gBAAgB,OAAOC;IAClC,+EAA+E;IAC/E,MAAM,EAAEC,KAAK,EAAEC,WAAW,EAAEC,mBAAmB,EAAEC,QAAQ,EAAE,GAAG,MAAMN,WAClEE,GAAGK,MAAM,EACTL,GAAGM,OAAO;IAGZ,IAAIF,SAASG,MAAM,EAAE;QACnB,IAAIC,UAAU,CAAC,0CAA0C,EAAEJ,SAASK,IAAI,CAAC,MAAM,IAAI,CAAC;QAEpF,IAAIP,aAAa;YACfM,WAAW,CAAC,uEAAuE,CAAC;QACtF;QAEAA,WAAW,CAAC,4CAA4C,CAAC;QAEzD,MAAM,EAAEE,SAASC,cAAc,EAAE,GAAG,MAAMhB,QACxC;YACEiB,MAAM;YACNC,MAAM;YACNC,SAAS;YACTN;QACF,GACA;YACEO,UAAU;gBACRC,QAAQC,IAAI,CAAC;YACf;QACF;QAGF,yCAAyC;QACzC,0DAA0D;QAC1D,IAAI,CAACN,gBAAgB;YACnBK,QAAQC,IAAI,CAAC;QACf;IACF;IAEA,MAAMhB;IAEN,0DAA0D;IAC1D,MAAMiB,mBAAmBlB,GAAGmB,QAAQ,CAACC,KAAK,CAAC,sBAAsB;QAC/DR,MAAMnB,QAAQ;QACd4B,OAAO9B,QAAQ;QACf+B,YAAY9B,UAAU;QACtB+B,YAAY/B,UAAU;IACxB;IAEA,MAAMgC,UAAU,MAAMxB,GAAGM,OAAO,CAC7BmB,MAAM,GACNC,IAAI,CAACR,kBACLS,KAAK,CAACrC,GAAG4B,iBAAiBG,KAAK,EAAE;IAEpC,IAAI,CAACG,QAAQjB,MAAM,EAAE;QACnB,MAAMP,GAAGM,OAAO,CAACsB,MAAM,CAACV,kBAAkBW,MAAM,CAAC;YAC/CjB,MAAM;YACNS,OAAO;QACT;IACF,OAAO;QACL,MAAMrB,GAAGM,OAAO,CACbwB,MAAM,CAACZ,kBACPa,GAAG,CAAC;YACHR,YAAY,IAAIS;QAClB,GACCL,KAAK,CAACrC,GAAG4B,iBAAiBG,KAAK,EAAE;IACtC;AACF,EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/db-postgres",
3
- "version": "3.0.0-alpha.41",
3
+ "version": "3.0.0-alpha.43",
4
4
  "description": "The officially supported Postgres database adapter for Payload",
5
5
  "repository": "https://github.com/payloadcms/payload",
6
6
  "license": "MIT",
@@ -27,10 +27,10 @@
27
27
  "@types/pg": "8.10.2",
28
28
  "@types/to-snake-case": "1.0.0",
29
29
  "@payloadcms/eslint-config": "1.1.1",
30
- "payload": "3.0.0-alpha.41"
30
+ "payload": "3.0.0-alpha.43"
31
31
  },
32
32
  "peerDependencies": {
33
- "payload": "3.0.0-alpha.41"
33
+ "payload": "3.0.0-alpha.43"
34
34
  },
35
35
  "publishConfig": {
36
36
  "registry": "https://registry.npmjs.org/"