@payloadcms/db-postgres 0.1.0-beta.0 → 0.1.0-beta.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. package/dist/connect.d.ts +3 -0
  2. package/dist/connect.d.ts.map +1 -0
  3. package/dist/connect.js +12 -12
  4. package/dist/create.d.ts +3 -0
  5. package/dist/create.d.ts.map +1 -0
  6. package/dist/create.js +2 -2
  7. package/dist/createGlobal.d.ts +5 -0
  8. package/dist/createGlobal.d.ts.map +1 -0
  9. package/dist/createGlobal.js +2 -2
  10. package/dist/createGlobalVersion.d.ts +6 -0
  11. package/dist/createGlobalVersion.d.ts.map +1 -0
  12. package/dist/createGlobalVersion.js +2 -2
  13. package/dist/createMigration.d.ts +3 -0
  14. package/dist/createMigration.d.ts.map +1 -0
  15. package/dist/createMigration.js +6 -6
  16. package/dist/createVersion.d.ts +5 -0
  17. package/dist/createVersion.d.ts.map +1 -0
  18. package/dist/createVersion.js +2 -2
  19. package/dist/deleteMany.d.ts +3 -0
  20. package/dist/deleteMany.d.ts.map +1 -0
  21. package/dist/deleteMany.js +2 -3
  22. package/dist/deleteOne.d.ts +3 -0
  23. package/dist/deleteOne.d.ts.map +1 -0
  24. package/dist/deleteOne.js +2 -2
  25. package/dist/deleteVersions.d.ts +3 -0
  26. package/dist/deleteVersions.d.ts.map +1 -0
  27. package/dist/deleteVersions.js +2 -2
  28. package/dist/destroy.d.ts +3 -0
  29. package/dist/destroy.d.ts.map +1 -0
  30. package/dist/extendViteConfig.d.ts +4 -0
  31. package/dist/extendViteConfig.d.ts.map +1 -0
  32. package/dist/extendViteConfig.js +38 -0
  33. package/dist/extendWebpackConfig.d.ts +4 -0
  34. package/dist/extendWebpackConfig.d.ts.map +1 -0
  35. package/dist/extendWebpackConfig.js +45 -0
  36. package/dist/find/buildFindManyArgs.d.ts +13 -0
  37. package/dist/find/buildFindManyArgs.d.ts.map +1 -0
  38. package/dist/find/chainMethods.d.ts +15 -0
  39. package/dist/find/chainMethods.d.ts.map +1 -0
  40. package/dist/find/findMany.d.ts +22 -0
  41. package/dist/find/findMany.d.ts.map +1 -0
  42. package/dist/find/findMany.js +2 -2
  43. package/dist/find/traverseFields.d.ts +16 -0
  44. package/dist/find/traverseFields.d.ts.map +1 -0
  45. package/dist/find.d.ts +3 -0
  46. package/dist/find.d.ts.map +1 -0
  47. package/dist/findGlobal.d.ts +3 -0
  48. package/dist/findGlobal.d.ts.map +1 -0
  49. package/dist/findGlobalVersions.d.ts +3 -0
  50. package/dist/findGlobalVersions.d.ts.map +1 -0
  51. package/dist/findOne.d.ts +5 -0
  52. package/dist/findOne.d.ts.map +1 -0
  53. package/dist/findOne.js +2 -2
  54. package/dist/findVersions.d.ts +3 -0
  55. package/dist/findVersions.d.ts.map +1 -0
  56. package/dist/index.d.ts +4 -0
  57. package/dist/index.d.ts.map +1 -0
  58. package/dist/index.js +8 -6
  59. package/dist/init.d.ts +3 -0
  60. package/dist/init.d.ts.map +1 -0
  61. package/dist/init.js +3 -4
  62. package/dist/migrate.d.ts +3 -0
  63. package/dist/migrate.d.ts.map +1 -0
  64. package/dist/migrate.js +4 -5
  65. package/dist/migrateStatus.d.ts +3 -0
  66. package/dist/migrateStatus.d.ts.map +1 -0
  67. package/dist/migrateStatus.js +2 -2
  68. package/dist/queries/buildAndOrConditions.d.ts +17 -0
  69. package/dist/queries/buildAndOrConditions.d.ts.map +1 -0
  70. package/dist/queries/buildQuery.d.ts +30 -0
  71. package/dist/queries/buildQuery.d.ts.map +1 -0
  72. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.d.ts +2 -0
  73. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.d.ts.map +1 -0
  74. package/dist/queries/createJSONQuery/formatJSONPathSegment.d.ts +2 -0
  75. package/dist/queries/createJSONQuery/formatJSONPathSegment.d.ts.map +1 -0
  76. package/dist/queries/createJSONQuery/index.d.ts +10 -0
  77. package/dist/queries/createJSONQuery/index.d.ts.map +1 -0
  78. package/dist/queries/getTableColumnFromPath.d.ts +40 -0
  79. package/dist/queries/getTableColumnFromPath.d.ts.map +1 -0
  80. package/dist/queries/operatorMap.d.ts +18 -0
  81. package/dist/queries/operatorMap.d.ts.map +1 -0
  82. package/dist/queries/parseParams.d.ts +17 -0
  83. package/dist/queries/parseParams.d.ts.map +1 -0
  84. package/dist/queries/parseParams.js +1 -1
  85. package/dist/queries/sanitizeQueryValue.d.ts +12 -0
  86. package/dist/queries/sanitizeQueryValue.d.ts.map +1 -0
  87. package/dist/queryDrafts.d.ts +3 -0
  88. package/dist/queryDrafts.d.ts.map +1 -0
  89. package/dist/reference.d.ts +2 -0
  90. package/dist/reference.d.ts.map +1 -0
  91. package/dist/schema/build.d.ts +23 -0
  92. package/dist/schema/build.d.ts.map +1 -0
  93. package/dist/schema/build.js +6 -5
  94. package/dist/schema/createIndex.d.ts +11 -0
  95. package/dist/schema/createIndex.d.ts.map +1 -0
  96. package/dist/schema/createIndex.js +12 -3
  97. package/dist/schema/parentIDColumnMap.d.ts +7 -0
  98. package/dist/schema/parentIDColumnMap.d.ts.map +1 -0
  99. package/dist/schema/traverseFields.d.ts +33 -0
  100. package/dist/schema/traverseFields.d.ts.map +1 -0
  101. package/dist/schema/traverseFields.js +25 -9
  102. package/dist/schema/validateExistingBlockIsIdentical.d.ts +11 -0
  103. package/dist/schema/validateExistingBlockIsIdentical.d.ts.map +1 -0
  104. package/dist/transactions/beginTransaction.d.ts +3 -0
  105. package/dist/transactions/beginTransaction.d.ts.map +1 -0
  106. package/dist/transactions/beginTransaction.js +2 -2
  107. package/dist/transactions/commitTransaction.d.ts +3 -0
  108. package/dist/transactions/commitTransaction.d.ts.map +1 -0
  109. package/dist/transactions/rollbackTransaction.d.ts +3 -0
  110. package/dist/transactions/rollbackTransaction.d.ts.map +1 -0
  111. package/dist/transform/read/hasManyNumber.d.ts +10 -0
  112. package/dist/transform/read/hasManyNumber.d.ts.map +1 -0
  113. package/dist/transform/read/index.d.ts +12 -0
  114. package/dist/transform/read/index.d.ts.map +1 -0
  115. package/dist/transform/read/relationship.d.ts +10 -0
  116. package/dist/transform/read/relationship.d.ts.map +1 -0
  117. package/dist/transform/read/traverseFields.d.ts +44 -0
  118. package/dist/transform/read/traverseFields.d.ts.map +1 -0
  119. package/dist/transform/write/array.d.ts +22 -0
  120. package/dist/transform/write/array.d.ts.map +1 -0
  121. package/dist/transform/write/blocks.d.ts +21 -0
  122. package/dist/transform/write/blocks.d.ts.map +1 -0
  123. package/dist/transform/write/index.d.ts +11 -0
  124. package/dist/transform/write/index.d.ts.map +1 -0
  125. package/dist/transform/write/numbers.d.ts +8 -0
  126. package/dist/transform/write/numbers.d.ts.map +1 -0
  127. package/dist/transform/write/relationships.d.ts +10 -0
  128. package/dist/transform/write/relationships.d.ts.map +1 -0
  129. package/dist/transform/write/selects.d.ts +7 -0
  130. package/dist/transform/write/selects.d.ts.map +1 -0
  131. package/dist/transform/write/traverseFields.d.ts +46 -0
  132. package/dist/transform/write/traverseFields.d.ts.map +1 -0
  133. package/dist/transform/write/types.d.ts +41 -0
  134. package/dist/transform/write/types.d.ts.map +1 -0
  135. package/dist/types.d.ts +67 -0
  136. package/dist/types.d.ts.map +1 -0
  137. package/dist/update.d.ts +3 -0
  138. package/dist/update.d.ts.map +1 -0
  139. package/dist/update.js +2 -2
  140. package/dist/updateGlobal.d.ts +5 -0
  141. package/dist/updateGlobal.d.ts.map +1 -0
  142. package/dist/updateGlobal.js +2 -2
  143. package/dist/updateGlobalVersion.d.ts +6 -0
  144. package/dist/updateGlobalVersion.d.ts.map +1 -0
  145. package/dist/updateGlobalVersion.js +2 -2
  146. package/dist/updateVersion.d.ts +5 -0
  147. package/dist/updateVersion.d.ts.map +1 -0
  148. package/dist/updateVersion.js +2 -2
  149. package/dist/upsertRow/deleteExistingArrayRows.d.ts +10 -0
  150. package/dist/upsertRow/deleteExistingArrayRows.d.ts.map +1 -0
  151. package/dist/upsertRow/deleteExistingRowsByPath.d.ts +14 -0
  152. package/dist/upsertRow/deleteExistingRowsByPath.d.ts.map +1 -0
  153. package/dist/upsertRow/index.d.ts +4 -0
  154. package/dist/upsertRow/index.d.ts.map +1 -0
  155. package/dist/upsertRow/insertArrays.d.ts +13 -0
  156. package/dist/upsertRow/insertArrays.d.ts.map +1 -0
  157. package/dist/upsertRow/types.d.ts +26 -0
  158. package/dist/upsertRow/types.d.ts.map +1 -0
  159. package/dist/utilities/appendPrefixToKeys.d.ts +2 -0
  160. package/dist/utilities/appendPrefixToKeys.d.ts.map +1 -0
  161. package/dist/utilities/createBlocksMap.d.ts +5 -0
  162. package/dist/utilities/createBlocksMap.d.ts.map +1 -0
  163. package/dist/utilities/createMigrationTable.d.ts +3 -0
  164. package/dist/utilities/createMigrationTable.d.ts.map +1 -0
  165. package/dist/utilities/createRelationshipMap.d.ts +2 -0
  166. package/dist/utilities/createRelationshipMap.d.ts.map +1 -0
  167. package/dist/utilities/hasLocalesTable.d.ts +3 -0
  168. package/dist/utilities/hasLocalesTable.d.ts.map +1 -0
  169. package/dist/utilities/isArrayOfRows.d.ts +2 -0
  170. package/dist/utilities/isArrayOfRows.d.ts.map +1 -0
  171. package/dist/utilities/migrationTableExists.d.ts +3 -0
  172. package/dist/utilities/migrationTableExists.d.ts.map +1 -0
  173. package/mock.js +1 -0
  174. package/package.json +16 -17
  175. package/src/index.ts +93 -0
  176. package/dist/mock.js +0 -13
  177. package/dist/webpack.js +0 -30
@@ -0,0 +1,3 @@
1
+ import type { Connect } from 'payload/database';
2
+ export declare const connect: Connect;
3
+ //# sourceMappingURL=connect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAU/C,eAAO,MAAM,OAAO,EAAE,OA0ErB,CAAA"}
package/dist/connect.js CHANGED
@@ -27,12 +27,12 @@ const connect = async function connect(payload) {
27
27
  try {
28
28
  this.pool = new _pg.Pool(this.client);
29
29
  await this.pool.connect();
30
- this.db = (0, _nodepostgres.drizzle)(this.pool, {
30
+ this.drizzle = (0, _nodepostgres.drizzle)(this.pool, {
31
31
  schema: this.schema
32
32
  });
33
33
  if (process.env.PAYLOAD_DROP_DATABASE === 'true') {
34
34
  this.payload.logger.info('---- DROPPING TABLES ----');
35
- await this.db.execute((0, _drizzleorm.sql)`drop schema public cascade;\ncreate schema public;`);
35
+ await this.drizzle.execute((0, _drizzleorm.sql)`drop schema public cascade;\ncreate schema public;`);
36
36
  this.payload.logger.info('---- DROPPED TABLES ----');
37
37
  }
38
38
  } catch (err) {
@@ -43,20 +43,20 @@ const connect = async function connect(payload) {
43
43
  // Only push schema if not in production
44
44
  if (process.env.NODE_ENV === 'production' || process.env.PAYLOAD_MIGRATING === 'true') return;
45
45
  // This will prompt if clarifications are needed for Drizzle to push new schema
46
- const { apply, hasDataLoss, statementsToExecute, warnings } = await (0, _utils.pushSchema)(this.schema, this.db);
47
- this.payload.logger.debug({
48
- hasDataLoss,
49
- msg: 'Schema push results',
50
- statementsToExecute,
51
- warnings
52
- });
46
+ const { apply, hasDataLoss, statementsToExecute, warnings } = await (0, _utils.pushSchema)(this.schema, this.drizzle);
47
+ // this.payload.logger.debug({
48
+ // hasDataLoss,
49
+ // msg: 'Schema push results',
50
+ // statementsToExecute,
51
+ // warnings,
52
+ // })
53
53
  if (warnings.length) {
54
- this.payload.logger.warn({
54
+ this.payload.logger.info({
55
55
  msg: `Warnings detected during schema push: ${warnings.join('\n')}`,
56
56
  warnings
57
57
  });
58
58
  if (hasDataLoss) {
59
- this.payload.logger.warn({
59
+ this.payload.logger.info({
60
60
  msg: 'DATA LOSS WARNING: Possible data loss detected if schema is pushed.'
61
61
  });
62
62
  }
@@ -79,4 +79,4 @@ const connect = async function connect(payload) {
79
79
  await apply();
80
80
  };
81
81
 
82
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jb25uZWN0LnRzIl0sInNvdXJjZXN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kFBTyxFQUMvQztZQUNFQyxNQUFNO1lBQ05DLFNBQVM7WUFDVGhCLFNBQVM7WUFDVGlCLE1BQU07UUFDUixHQUNBO1lBQ0VDLFVBQVU7Z0JBQ1IzQixRQUFRVSxJQUFJLENBQUM7WUFDZjtRQUNGO1FBR0YseUNBQXlDO1FBQ3pDLDBEQUEwRDtRQUMxRCxJQUFJLENBQUNZLGdCQUFnQjtZQUNuQnRCLFFBQVFVLElBQUksQ0FBQztRQUNmO0lBQ0Y7SUFFQSxNQUFNRztBQUNSIn0=
@@ -0,0 +1,3 @@
1
+ import type { Create } from 'payload/database';
2
+ export declare const create: Create;
3
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAQ9C,eAAO,MAAM,MAAM,EAAE,MAiBpB,CAAA"}
package/dist/create.js CHANGED
@@ -16,7 +16,7 @@ function _interop_require_default(obj) {
16
16
  };
17
17
  }
18
18
  const create = async function create({ collection: collectionSlug, data, req }) {
19
- const db = this.sessions[req.transactionID]?.db || this.db;
19
+ const db = this.sessions[req.transactionID]?.db || this.drizzle;
20
20
  const collection = this.payload.collections[collectionSlug].config;
21
21
  const result = await (0, _upsertRow.upsertRow)({
22
22
  adapter: this,
@@ -29,4 +29,4 @@ const create = async function create({ collection: collectionSlug, data, req })
29
29
  return result;
30
30
  };
31
31
 
32
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jcmVhdGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBDcmVhdGUgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuXG5pbXBvcnQgdG9TbmFrZUNhc2UgZnJvbSAndG8tc25ha2UtY2FzZSdcblxuaW1wb3J0IHsgdXB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BTUMsSUFBQUEsb0JBQVMsRUFBQztRQUM3QkMsU0FBUyxJQUFJO1FBQ2JYO1FBQ0FFO1FBQ0FVLFFBQVFkLFdBQVdjLE1BQU07UUFDekJDLFdBQVc7UUFDWEMsV0FBV0MsSUFBQUEsb0JBQVcsRUFBQ2hCO0lBQ3pCO0lBRUEsT0FBT1U7QUFDVCJ9
@@ -0,0 +1,5 @@
1
+ import type { CreateGlobalArgs } from 'payload/database';
2
+ import type { TypeWithID } from 'payload/types';
3
+ import type { PostgresAdapter } from './types';
4
+ export declare function createGlobal<T extends TypeWithID>(this: PostgresAdapter, { data, req, slug }: CreateGlobalArgs): Promise<T>;
5
+ //# sourceMappingURL=createGlobal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createGlobal.d.ts","sourceRoot":"","sources":["../src/createGlobal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAkB,UAAU,EAAE,MAAM,eAAe,CAAA;AAI/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,wBAAsB,YAAY,CAAC,CAAC,SAAS,UAAU,EACrD,IAAI,EAAE,eAAe,EACrB,EAAE,IAAI,EAAE,GAA0B,EAAE,IAAI,EAAE,EAAE,gBAAgB,GAC3D,OAAO,CAAC,CAAC,CAAC,CAcZ"}
@@ -16,7 +16,7 @@ function _interop_require_default(obj) {
16
16
  };
17
17
  }
18
18
  async function createGlobal({ data, req = {}, slug }) {
19
- const db = this.sessions[req.transactionID]?.db || this.db;
19
+ const db = this.sessions[req.transactionID]?.db || this.drizzle;
20
20
  const globalConfig = this.payload.globals.config.find((config)=>config.slug === slug);
21
21
  const result = await (0, _upsertRow.upsertRow)({
22
22
  adapter: this,
@@ -29,4 +29,4 @@ async function createGlobal({ data, req = {}, slug }) {
29
29
  return result;
30
30
  }
31
31
 
32
- //# sourceMappingURL=data:application/json;base64,eyJ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B9KVxuXG4gIHJldHVybiByZXN1bHRcbn1cbiJdLCJuYW1lcyI6WyJjcmVhdGVHbG9iYWwiLCJkYXRhIiwicmVxIiwic2x1ZyIsImRiIiwic2Vzc2lvbnMiLCJ0cmFuc2FjdGlvbklEIiwiZHJpenpsZSIsImdsb2JhbENvbmZpZyIsInBheWxvYWQiLCJnbG9iYWxzIiwiY29uZmlnIiwiZmluZCIsInJlc3VsdCIsInVwc2VydFJvdyIsImFkYXB0ZXIiLCJmaWVsZHMiLCJvcGVyYXRpb24iLCJ0YWJsZU5hbWUiLCJ0b1NuYWtlQ2FzZSJdLCJtYXBwaW5ncyI6Ijs7OzsrQkFTc0JBOzs7ZUFBQUE7OztvRUFORTsyQkFJRTs7Ozs7O0FBRW5CLGVBQWVBLGFBRXBCLEVBQUVDLElBQUksRUFBRUMsTUFBTSxDQUFDLENBQW1CLEVBQUVDLElBQUksRUFBb0I7SUFFNUQsTUFBTUMsS0FBSyxJQUFJLENBQUNDLFFBQVEsQ0FBQ0gsSUFBSUksYUFBYSxDQUFDLEVBQUVGLE1BQU0sSUFBSSxDQUFDRyxPQUFPO0lBQy9ELE1BQU1DLGVBQWUsSUFBSSxDQUFDQyxPQUFPLENBQUNDLE9BQU8sQ0FBQ0MsTUFBTSxDQUFDQyxJQUFJLENBQUMsQ0FBQ0QsU0FBV0EsT0FBT1IsSUFBSSxLQUFLQTtJQUVsRixNQUFNVSxTQUFTLE1BQU1DLElBQUFBLG9CQUFTLEVBQUk7UUFDaENDLFNBQVMsSUFBSTtRQUNiZDtRQUNBRztRQUNBWSxRQUFRUixhQUFhUSxNQUFNO1FBQzNCQyxXQUFXO1FBQ1hDLFdBQVdDLElBQUFBLG9CQUFXLEVBQUNoQjtJQUN6QjtJQUVBLE9BQU9VO0FBQ1QifQ==
@@ -0,0 +1,6 @@
1
+ import type { TypeWithVersion } from 'payload/database';
2
+ import type { TypeWithID } from 'payload/types';
3
+ import { type CreateGlobalVersionArgs } from 'payload/database';
4
+ import type { PostgresAdapter } from './types';
5
+ export declare function createGlobalVersion<T extends TypeWithID>(this: PostgresAdapter, { autosave, globalSlug, req, versionData }: CreateGlobalVersionArgs): Promise<TypeWithVersion<T>>;
6
+ //# sourceMappingURL=createGlobalVersion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createGlobalVersion.d.ts","sourceRoot":"","sources":["../src/createGlobalVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAkB,UAAU,EAAE,MAAM,eAAe,CAAA;AAG/D,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAI/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,wBAAsB,mBAAmB,CAAC,CAAC,SAAS,UAAU,EAC5D,IAAI,EAAE,eAAe,EACrB,EAAE,QAAQ,EAAE,UAAU,EAAE,GAA0B,EAAE,WAAW,EAAE,EAAE,uBAAuB,+BA+B3F"}
@@ -18,7 +18,7 @@ function _interop_require_default(obj) {
18
18
  };
19
19
  }
20
20
  async function createGlobalVersion({ autosave, globalSlug, req = {}, versionData }) {
21
- const db = this.sessions[req.transactionID]?.db || this.db;
21
+ const db = this.sessions[req.transactionID]?.db || this.drizzle;
22
22
  const global = this.payload.globals.config.find(({ slug })=>slug === globalSlug);
23
23
  const globalTableName = (0, _tosnakecase.default)(globalSlug);
24
24
  const tableName = `_${globalTableName}_v`;
@@ -45,4 +45,4 @@ async function createGlobalVersion({ autosave, globalSlug, req = {}, versionData
45
45
  return result;
46
46
  }
47
47
 
48
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jcmVhdGVHbG9iYWxWZXJzaW9uLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgVHlwZVdpdGhWZXJzaW9uIH0gZnJvbSAncGF5bG9h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DLENBQUMsRUFBRUYsZ0JBQWdCLEVBQUUsQ0FBQztJQUV6QyxNQUFNRyxTQUFTLE1BQU1DLElBQUFBLG9CQUFTLEVBQXFCO1FBQ2pEQyxTQUFTLElBQUk7UUFDYkMsTUFBTTtZQUNKcEI7WUFDQXFCLFFBQVE7WUFDUkMsU0FBU25CO1FBQ1g7UUFDQUM7UUFDQW1CLFFBQVFDLElBQUFBLGtDQUF3QixFQUFDaEI7UUFDakNpQixXQUFXO1FBQ1hUO0lBQ0Y7SUFFQSxNQUFNVSxRQUFRLElBQUksQ0FBQ0MsTUFBTSxDQUFDWCxVQUFVO0lBRXBDLElBQUlSLE9BQU9vQixRQUFRLENBQUNDLE1BQU0sRUFBRTtRQUMxQixNQUFNekIsR0FBRzBCLE9BQU8sQ0FBQ0MsSUFBQUEsZUFBRyxDQUFBLENBQUM7YUFDWixFQUFFTCxNQUFNOztZQUVULEVBQUVBLE1BQU1NLEVBQUUsQ0FBQyxJQUFJLEVBQUVmLE9BQU9lLEVBQUUsQ0FBQztJQUNuQyxDQUFDO0lBQ0g7SUFFQSxPQUFPZjtBQUNUIn0=
@@ -0,0 +1,3 @@
1
+ import type { CreateMigration } from 'payload/database';
2
+ export declare const createMigration: CreateMigration;
3
+ //# sourceMappingURL=createMigration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createMigration.d.ts","sourceRoot":"","sources":["../src/createMigration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAqDvD,eAAO,MAAM,eAAe,EAAE,eAmD7B,CAAA"}
@@ -16,18 +16,18 @@ function _interop_require_default(obj) {
16
16
  default: obj
17
17
  };
18
18
  }
19
- const migrationTemplate = (upSQL, downSQL)=>`import { MigrateUpArgs, MigrateDownArgs } from '@payloadcms/db-postgres/types'
19
+ const migrationTemplate = (upSQL, downSQL)=>`import { MigrateUpArgs, MigrateDownArgs } from '@payloadcms/db-postgres'
20
20
  import { sql } from 'drizzle-orm'
21
21
 
22
22
  export async function up({ payload }: MigrateUpArgs): Promise<void> {
23
- ${upSQL ? `await payload.db.db.execute(sql\`
23
+ ${upSQL ? `await payload.db.drizzle.execute(sql\`
24
24
 
25
25
  ${upSQL}\`);
26
26
  ` : '// Migration code'}
27
27
  };
28
28
 
29
- export async function down({ payload }: MigrateUpArgs): Promise<void> {
30
- ${downSQL ? `await payload.db.db.execute(sql\`
29
+ export async function down({ payload }: MigrateDownArgs): Promise<void> {
30
+ ${downSQL ? `await payload.db.drizzle.execute(sql\`
31
31
 
32
32
  ${downSQL}\`);
33
33
  ` : '// Migration code'}
@@ -62,7 +62,7 @@ const createMigration = async function createMigration(payload, migrationName) {
62
62
  const fileName = migrationName ? `${timestamp}_${migrationName.replace(/\W/g, '_')}.ts` : `${timestamp}.ts`;
63
63
  const filePath = `${dir}/${fileName}`;
64
64
  let drizzleJsonBefore = getDefaultDrizzleSnapshot();
65
- const hasMigrationTable = await (0, _migrationTableExists.migrationTableExists)(this.db);
65
+ const hasMigrationTable = await (0, _migrationTableExists.migrationTableExists)(this.drizzle);
66
66
  if (hasMigrationTable) {
67
67
  const migrationQuery = await payload.find({
68
68
  collection: 'payload-migrations',
@@ -82,4 +82,4 @@ const createMigration = async function createMigration(payload, migrationName) {
82
82
  });
83
83
  };
84
84
 
85
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jcmVhdGVNaWdyYXRpb24udHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tcmVzdHJpY3RlZC1zeW50YXgsIG5vLWF3YWl0LWluLWxvb3AgKi9cbmltcG9ydCB0eXBlIHsgRHJpenpsZVNuYXBzaG90SlNPTiB9IGZyb20gJ2RyaXp6bGUta2l0L3V0aWxzJ1xuaW1wb3J0IHR5cGUgeyBDcmVhdGVNaWdyYXRpb24gfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ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QUFNRyxrQkFBa0IsTUFBTUMsSUFBQUEsd0JBQWlCLEVBQUNkLG1CQUFtQlc7SUFDbkUsTUFBTUksb0JBQW9CLE1BQU1ELElBQUFBLHdCQUFpQixFQUFDSCxrQkFBa0JYO0lBRXBFZCxXQUFFLENBQUM4QixhQUFhLENBQ2RqQixVQUNBbEMsa0JBQ0VnRCxnQkFBZ0JJLE1BQU0sR0FBR0osaUJBQWlCSyxLQUFLLFFBQVFDLFdBQ3ZESixrQkFBa0JFLE1BQU0sR0FBR0YsbUJBQW1CRyxLQUFLLFFBQVFDO0lBRy9EekMsUUFBUUUsTUFBTSxDQUFDQyxJQUFJLENBQUM7UUFBRUMsS0FBSyxDQUFDLHFCQUFxQixFQUFFaUIsU0FBUyxDQUFDO0lBQUM7QUFDaEUifQ==
@@ -0,0 +1,5 @@
1
+ import type { CreateVersionArgs, TypeWithVersion } from 'payload/database';
2
+ import type { TypeWithID } from 'payload/types';
3
+ import type { PostgresAdapter } from './types';
4
+ export declare function createVersion<T extends TypeWithID>(this: PostgresAdapter, { autosave, collectionSlug, parent, req, versionData, }: CreateVersionArgs<T>): Promise<TypeWithVersion<T>>;
5
+ //# sourceMappingURL=createVersion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createVersion.d.ts","sourceRoot":"","sources":["../src/createVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC1E,OAAO,KAAK,EAAkB,UAAU,EAAE,MAAM,eAAe,CAAA;AAM/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,wBAAsB,aAAa,CAAC,CAAC,SAAS,UAAU,EACtD,IAAI,EAAE,eAAe,EACrB,EACE,QAAQ,EACR,cAAc,EACd,MAAM,EACN,GAA0B,EAC1B,WAAW,GACZ,EAAE,iBAAiB,CAAC,CAAC,CAAC,+BAqCxB"}
@@ -18,7 +18,7 @@ function _interop_require_default(obj) {
18
18
  };
19
19
  }
20
20
  async function createVersion({ autosave, collectionSlug, parent, req = {}, versionData }) {
21
- const db = this.sessions[req.transactionID]?.db || this.db;
21
+ const db = this.sessions[req.transactionID]?.db || this.drizzle;
22
22
  const collection = this.payload.collections[collectionSlug].config;
23
23
  const collectionTableName = (0, _tosnakecase.default)(collectionSlug);
24
24
  const tableName = `_${collectionTableName}_v`;
@@ -51,4 +51,4 @@ async function createVersion({ autosave, collectionSlug, parent, req = {}, versi
51
51
  return result;
52
52
  }
53
53
 
54
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jcmVhdGVWZXJzaW9uLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgQ3JlYXRlVmVyc2lvbkFyZ3MsIFR5cGVXaXRoVmVyc2lvbiB9IGZyb20gJ3BheWxvYWQvZGF0YWJhc2UnXG5pbXBvcnQgdHlwZSB7IFBheWxvYWRSZXF1ZXN0LCBUeXBlV2l0aElEIH0gZnJvbSAncGF5bG9hZC90eXBlcydcblxuaW1wb3J0IHsgc3FsIH0gZnJvbSAnZHJpenpsZS1vcm0nXG5pbXBvcnQgeyBidWlsZFZlcnNpb25Db2xsZWN0aW9uRmllbGRzIH0gZnJvbSAncGF5bG9hZC92ZXJzaW9ucydcbmltcG9ydCB0b1NuYWtlQ2FzZSBmcm9tICd0by1zbmFrZS1jYXNlJ1xuXG5pbXBvcnQgdHlwZSB7IFBvc3RncmVzQWRhcHRlciB9IGZyb20gJy4vdHlwZXMnXG5cbmltcG9ydCB7IHVwc2VydFJvdyB9IGZyb20gJy4vdXBzZXJ0Um93J1xuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gY3JlYXRlVmVyc2lvbjxUIGV4dGVuZHMgVHlwZVdpdGhJRD4oXG4gIHRoaXM6IFBvc3RncmVzQWRhcHRlcixcbiAge1xuICAgIGF1dG9zYXZlLFxuICAgIGNvbGx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UIsT0FBTyxDQUFDQyxJQUFBQSxlQUFHLENBQUEsQ0FBQzthQUNaLEVBQUVOLE1BQU07O1dBRVYsRUFBRUUsbUJBQW1CO1lBQ3BCLEVBQUVGLE1BQU1PLEVBQUUsQ0FBQyxHQUFHLEVBQUVMLG1CQUFtQnpCLE1BQU0sQ0FBQztZQUMxQyxFQUFFeUIsbUJBQW1CTSxJQUFJLENBQUMsR0FBRyxFQUFFLFNBQVM7WUFDeEMsRUFBRU4sa0JBQWtCLENBQUMsQ0FBQyxFQUFFMUIsZUFBZSxFQUFFLENBQUMsQ0FBQyxDQUFDLEdBQUcsRUFBRUMsT0FBTztZQUN4RCxFQUFFdUIsTUFBTU8sRUFBRSxDQUFDLElBQUksRUFBRWhCLE9BQU9nQixFQUFFLENBQUM7RUFDckMsQ0FBQztJQUNEO0lBRUEsT0FBT2hCO0FBQ1QifQ==
@@ -0,0 +1,3 @@
1
+ import type { DeleteMany } from 'payload/database';
2
+ export declare const deleteMany: DeleteMany;
3
+ //# sourceMappingURL=deleteMany.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteMany.d.ts","sourceRoot":"","sources":["../src/deleteMany.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAUlD,eAAO,MAAM,UAAU,EAAE,UA6BxB,CAAA"}
@@ -17,7 +17,7 @@ function _interop_require_default(obj) {
17
17
  };
18
18
  }
19
19
  const deleteMany = async function deleteMany({ collection, req = {}, where }) {
20
- const db = this.sessions[req.transactionID]?.db || this.db;
20
+ const db = this.sessions[req.transactionID]?.db || this.drizzle;
21
21
  const collectionConfig = this.payload.collections[collection].config;
22
22
  const tableName = (0, _tosnakecase.default)(collection);
23
23
  const result = await (0, _findMany.findMany)({
@@ -38,7 +38,6 @@ const deleteMany = async function deleteMany({ collection, req = {}, where }) {
38
38
  if (ids.length > 0) {
39
39
  await db.delete(this.tables[tableName]).where((0, _drizzleorm.inArray)(this.tables[tableName].id, ids));
40
40
  }
41
- return result;
42
41
  };
43
42
 
44
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kZWxldGVNYW55LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgRGVsZXRlTWFueSB9IGZyb20gJ3BheWxvYWQvZGF0YWJhc2UnXG5pbXBvcnQgdHlwZSB7IFBheWxvYWRSZXF1ZXN0IH0gZnJvbSAncGF5bG9hZC90eXBlcydcblxuaW1wb3J0IHsgaW5BcnJheSB9IGZyb20gJ2RyaXp6bGUtb3JtJ1xuaW1wb3J0IHRvU25ha2VDYXNlIGZyb20gJ3RvLXNuYWtlLWNhc2UnXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi90eXBlcydcblxuaW1wb3J0IHsgZmluZE1hbnkgfSBmcm9tICcuL2ZpbmQvZmluZE1hbnknXG5cbmV4cG9ydCBjb25zdCBkZWxldGVNYW55OiBEZWxldGVNYW55ID0gYXN5bmMgZnVuY3Rpb24gZGVsZXRlTWFueShcbiAgdGhpczogUG9zdGdyZXNBZGFwdGVyLFxuICB7IGNvbGxlY3Rpb24sIHJlcSA9IHt9IGFzIFBheWxvYWRSZXF1ZXN0LCB3aGVyZSB9LFxuKSB7XG4gIGNvbnN0IGRiID0gdGhpcy5zZXNzaW9uc1tyZXEudHJhbnNhY3Rpb25JRF0/LmRiIHx8IHRoaXMuZGJcbiAgY29uc3QgY29sbGVjdGlvbkNvbmZpZyA9IHRoaXMucGF5bG9hZC5jb2xsZWN0aW9uc1tjb2xsZWN0aW9uXS5jb25maWdcbiAgY29uc3QgdGFibGVOYW1lID0gdG9TbmFrZUNhc2UoY29sbGVjdGlvbilcblxuICBjb25zdCByZXN1bHQgPSBhd2FpdCBmaW5kTWFueSh7XG4gICAgYWRhcHRlcjogdGhpcyxcbiAgICBmaWVsZHM6IGNvbGxlY3R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VcsQ0FBQ1UsTUFBTTtJQUNwRSxNQUFNQyxZQUFZQyxJQUFBQSxvQkFBVyxFQUFDWjtJQUU5QixNQUFNYSxTQUFTLE1BQU1DLElBQUFBLGtCQUFRLEVBQUM7UUFDNUJDLFNBQVMsSUFBSTtRQUNiQyxRQUFRVCxpQkFBaUJTLE1BQU07UUFDL0JDLE9BQU87UUFDUEMsUUFBUWpCLElBQUlpQixNQUFNO1FBQ2xCQyxNQUFNO1FBQ05DLFlBQVk7UUFDWm5CO1FBQ0FVO1FBQ0FUO0lBQ0Y7SUFFQSxNQUFNbUIsTUFBTSxFQUFFO0lBRWRSLE9BQU9TLElBQUksQ0FBQ0MsT0FBTyxDQUFDLENBQUNDO1FBQ25CSCxJQUFJSSxJQUFJLENBQUNELEtBQUtFLEVBQUU7SUFDbEI7SUFFQSxJQUFJTCxJQUFJTSxNQUFNLEdBQUcsR0FBRztRQUNsQixNQUFNeEIsR0FBR3lCLE1BQU0sQ0FBQyxJQUFJLENBQUNDLE1BQU0sQ0FBQ2xCLFVBQVUsRUFBRVQsS0FBSyxDQUFDNEIsSUFBQUEsbUJBQU8sRUFBQyxJQUFJLENBQUNELE1BQU0sQ0FBQ2xCLFVBQVUsQ0FBQ2UsRUFBRSxFQUFFTDtJQUNuRjtBQUNGIn0=
@@ -0,0 +1,3 @@
1
+ import type { DeleteOne } from 'payload/database';
2
+ export declare const deleteOne: DeleteOne;
3
+ //# sourceMappingURL=deleteOne.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteOne.d.ts","sourceRoot":"","sources":["../src/deleteOne.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAWjD,eAAO,MAAM,SAAS,EAAE,SAmCvB,CAAA"}
package/dist/deleteOne.js CHANGED
@@ -18,7 +18,7 @@ function _interop_require_default(obj) {
18
18
  };
19
19
  }
20
20
  const deleteOne = async function deleteOne({ collection, req = {}, where: incomingWhere }) {
21
- const db = this.sessions[req.transactionID]?.db || this.db;
21
+ const db = this.sessions[req.transactionID]?.db || this.drizzle;
22
22
  const collectionConfig = this.payload.collections[collection].config;
23
23
  const tableName = (0, _tosnakecase.default)(collection);
24
24
  const { where } = await (0, _buildQuery.default)({
@@ -44,4 +44,4 @@ const deleteOne = async function deleteOne({ collection, req = {}, where: incomi
44
44
  return result;
45
45
  };
46
46
 
47
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kZWxldGVPbmUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBEZWxldGVPbmUgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuaW1wb3J0IHR5cGUgeyBQYXlsb2FkUmVxdWVzdCB9IGZyb20gJ3BheWxvYWQvdHlwZXMnXG5cbmltcG9ydCB0b1NuYWtlQ2FzZSBmcm9tICd0by1zbmFrZS1jYXNlJ1xuXG5pbXBvcnQgdHlwZSB7IFBvc3RncmVzQWRhcHRlciB9IGZyb20gJy4vdHlwZXMnXG5cbmltcG9ydCB7IGJ1aWxkRmluZE1hbnlBcmdzIH0gZnJvbSAnLi9maW5kL2J1aWxkRmluZE1hbnlBcmdzJ1xuaW1wb3J0IGJ1aWxkUXVlcnkgZnJvbSAnLi9xdWVyaWVzL2J1aWxkUXVlcnknXG5pbXBvcnQgeyB0cmFuc2Zvcm0gfSBmcm9tICcuL3RyYW5zZm9ybS9yZWFkJ1xuXG5leHBvcnQgY29uc3QgZGVsZXRlT25lOiBEZWxldGVPbmUgPSBhc3luYyBmdW5jdGlvbiBkZWxldGVPbmUoXG4gIHRoaXM6IFBvc3RncmVzQWRhcHRlcixcbiAgeyBjb2xsZWN0aW9uLCByZXEgPSB7fSBhcyBQYXlsb2FkUmVxdWVzdCwgd2hlcmU6IGluY29taW5nV2hlcmUgfSxcbikge1xuICBjb25zdCBkYiA9IHRoaXMuc2Vzc2lvbnNbcmVx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FlBQVlDLElBQUFBLG9CQUFXLEVBQUNiO0lBRTlCLE1BQU0sRUFBRUUsS0FBSyxFQUFFLEdBQUcsTUFBTVksSUFBQUEsbUJBQVUsRUFBQztRQUNqQ0MsU0FBUyxJQUFJO1FBQ2JDLFFBQVFSLGlCQUFpQlEsTUFBTTtRQUMvQko7UUFDQVYsT0FBT0M7SUFDVDtJQUVBLE1BQU1jLGVBQWVDLElBQUFBLG9DQUFpQixFQUFDO1FBQ3JDSCxTQUFTLElBQUk7UUFDYkksT0FBTztRQUNQSCxRQUFRUixpQkFBaUJRLE1BQU07UUFDL0JKO0lBQ0Y7SUFFQUssYUFBYWYsS0FBSyxHQUFHQTtJQUVyQixNQUFNa0IsY0FBYyxNQUFNaEIsR0FBR2lCLEtBQUssQ0FBQ1QsVUFBVSxDQUFDVSxTQUFTLENBQUNMO0lBRXhELE1BQU1NLFNBQVNDLElBQUFBLGVBQVMsRUFBQztRQUN2QmIsUUFBUSxJQUFJLENBQUNGLE9BQU8sQ0FBQ0UsTUFBTTtRQUMzQmMsTUFBTUw7UUFDTkosUUFBUVIsaUJBQWlCUSxNQUFNO0lBQ2pDO0lBRUEsTUFBTVosR0FBR3NCLE1BQU0sQ0FBQyxJQUFJLENBQUNDLE1BQU0sQ0FBQ2YsVUFBVSxFQUFFVixLQUFLLENBQUNBO0lBRTlDLE9BQU9xQjtBQUNUIn0=
@@ -0,0 +1,3 @@
1
+ import type { DeleteVersions } from 'payload/database';
2
+ export declare const deleteVersions: DeleteVersions;
3
+ //# sourceMappingURL=deleteVersions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteVersions.d.ts","sourceRoot":"","sources":["../src/deleteVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAWtD,eAAO,MAAM,cAAc,EAAE,cAiC5B,CAAA"}
@@ -18,7 +18,7 @@ function _interop_require_default(obj) {
18
18
  };
19
19
  }
20
20
  const deleteVersions = async function deleteVersion({ collection, locale, req = {}, where: where }) {
21
- const db = this.sessions[req.transactionID]?.db || this.db;
21
+ const db = this.sessions[req.transactionID]?.db || this.drizzle;
22
22
  const collectionConfig = this.payload.collections[collection].config;
23
23
  const tableName = `_${(0, _tosnakecase.default)(collection)}_v`;
24
24
  const fields = (0, _versions.buildVersionCollectionFields)(collectionConfig);
@@ -43,4 +43,4 @@ const deleteVersions = async function deleteVersion({ collection, locale, req =
43
43
  return docs;
44
44
  };
45
45
 
46
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kZWxldGVWZXJzaW9ucy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IERlbGV0ZVZlcnNpb25zIH0gZnJvbSAncGF5bG9hZC9kYXRhYmFzZSdcbmltcG9ydCB0eXBlIHsgUGF5bG9hZFJlcXVlc3QsIFNhbml0aXplZENvbGxlY3Rpb25Db25maWcgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyBpbkFycmF5IH0gZnJvbSAnZHJpenpsZS1vcm0nXG5pbXBvcnQgeyBidWlsZFZlcnNpb25Db2xsZWN0aW9uRmllbGRzIH0gZnJvbSAncGF5bG9hZC92ZXJzaW9ucydcbmltcG9ydCB0b1NuYWtlQ2FzZSBmcm9tICd0by1zbmFrZS1jYXNlJ1xuXG5pbXBvcnQgdHlwZSB7IFBvc3RncmVzQWRhcHRlciB9IGZyb20gJy4vdHlwZXMnXG5cbmltcG9ydCB7IGZpbmRNYW55IH0gZnJvbSAnLi9maW5kL2ZpbmRNYW55J1xuXG5leHBvcnQgY29uc3QgZGVsZXRlVmVyc2lvbnM6IERlbGV0ZVZlcnNpb25zID0gYXN5bmMgZnVuY3Rpb24gZGVsZXRlVmVyc2lvbihcbiAgdGhpczogUG9zdGdyZXNBZGFwdGVyLFxuICB7IGNvbGxlY3Rpb24sIGxvY2FsZSwgcmVx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sb0JBQVcsRUFBQ2IsWUFBWSxFQUFFLENBQUM7SUFDakQsTUFBTWMsU0FBU0MsSUFBQUEsc0NBQTRCLEVBQUNQO0lBRTVDLE1BQU0sRUFBRVEsSUFBSSxFQUFFLEdBQUcsTUFBTUMsSUFBQUEsa0JBQVEsRUFBQztRQUM5QkMsU0FBUyxJQUFJO1FBQ2JKO1FBQ0FLLE9BQU87UUFDUGxCO1FBQ0FtQixNQUFNO1FBQ05DLFlBQVk7UUFDWm5CO1FBQ0FVO1FBQ0FUO0lBQ0Y7SUFFQSxNQUFNbUIsTUFBTSxFQUFFO0lBRWROLEtBQUtPLE9BQU8sQ0FBQyxDQUFDQztRQUNaRixJQUFJRyxJQUFJLENBQUNELElBQUlFLEVBQUU7SUFDakI7SUFFQSxJQUFJSixJQUFJSyxNQUFNLEdBQUcsR0FBRztRQUNsQixNQUFNdkIsR0FBR3dCLE1BQU0sQ0FBQyxJQUFJLENBQUNDLE1BQU0sQ0FBQ2pCLFVBQVUsRUFBRVQsS0FBSyxDQUFDMkIsSUFBQUEsbUJBQU8sRUFBQyxJQUFJLENBQUNELE1BQU0sQ0FBQ2pCLFVBQVUsQ0FBQ2MsRUFBRSxFQUFFSjtJQUNuRjtJQUVBLE9BQU9OO0FBQ1QifQ==
@@ -0,0 +1,3 @@
1
+ import type { Destroy } from 'payload/database';
2
+ export declare const destroy: Destroy;
3
+ //# sourceMappingURL=destroy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"destroy.d.ts","sourceRoot":"","sources":["../src/destroy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAI/C,eAAO,MAAM,OAAO,EAAE,OAGrB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { SanitizedConfig } from 'payload/config';
2
+ export declare const vite: (config: any) => any;
3
+ export declare const extendViteConfig: (config: SanitizedConfig) => void;
4
+ //# sourceMappingURL=extendViteConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extendViteConfig.d.ts","sourceRoot":"","sources":["../src/extendViteConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD,eAAO,MAAM,IAAI,sBAQhB,CAAA;AAED,eAAO,MAAM,gBAAgB,WAAY,eAAe,SAMvD,CAAA"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ vite: function() {
13
+ return vite;
14
+ },
15
+ extendViteConfig: function() {
16
+ return extendViteConfig;
17
+ }
18
+ });
19
+ const vite = (config)=>{
20
+ return {
21
+ ...config,
22
+ optimizeDeps: {
23
+ ...config.optimizeDeps,
24
+ exclude: [
25
+ ...config.optimizeDeps.exclude,
26
+ '@payloadcms/db-postgres'
27
+ ]
28
+ }
29
+ };
30
+ };
31
+ const extendViteConfig = (config)=>{
32
+ const existingViteConfig = config.admin.vite ? config.admin.vite : (viteConfig)=>viteConfig;
33
+ config.admin.vite = (webpackConfig)=>{
34
+ return vite(existingViteConfig(webpackConfig));
35
+ };
36
+ };
37
+
38
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9leHRlbmRWaXRlQ29uZmlnLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgU2FuaXRpemVkQ29uZmlnIH0gZnJvbSAncGF5bG9hZC9jb25maWcnXG5cbmV4cG9ydCBjb25zdCB2aXRlID0gKGNvbmZpZykgPT4ge1xuICByZXR1cm4ge1xuICAgIC4uLmNvbmZpZyxcbiAgICBvcHRpbWl6ZURlcHM6IHtcbiAgICAgIC4uLmNvbmZpZy5vcHRpbWl6ZURlcHMsXG4gICAgICBle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UNPLGFBQWVBO0lBRW5GTCxPQUFPSSxLQUFLLENBQUNOLElBQUksR0FBRyxDQUFDUTtRQUNuQixPQUFPUixLQUFLSyxtQkFBbUJHO0lBQ2pDO0FBQ0YifQ==
@@ -0,0 +1,4 @@
1
+ import type { SanitizedConfig } from 'payload/config';
2
+ export declare const webpack: (config: any) => any;
3
+ export declare const extendWebpackConfig: (config: SanitizedConfig) => void;
4
+ //# sourceMappingURL=extendWebpackConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extendWebpackConfig.d.ts","sourceRoot":"","sources":["../src/extendWebpackConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAIrD,eAAO,MAAM,OAAO,sBAanB,CAAA;AAED,eAAO,MAAM,mBAAmB,WAAY,eAAe,SAQ1D,CAAA"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ webpack: function() {
13
+ return webpack;
14
+ },
15
+ extendWebpackConfig: function() {
16
+ return extendWebpackConfig;
17
+ }
18
+ });
19
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
20
+ function _interop_require_default(obj) {
21
+ return obj && obj.__esModule ? obj : {
22
+ default: obj
23
+ };
24
+ }
25
+ const webpack = (config)=>{
26
+ const aliasPath = _path.default.resolve(__dirname, '../mock.js');
27
+ return {
28
+ ...config,
29
+ resolve: {
30
+ ...config.resolve || {},
31
+ alias: {
32
+ ...config.resolve?.alias || {},
33
+ '@payloadcms/db-postgres': aliasPath
34
+ }
35
+ }
36
+ };
37
+ };
38
+ const extendWebpackConfig = (config)=>{
39
+ const existingWebpackConfig = config.admin.webpack ? config.admin.webpack : (webpackConfig)=>webpackConfig;
40
+ config.admin.webpack = (webpackConfig)=>{
41
+ return webpack(existingWebpackConfig(webpackConfig));
42
+ };
43
+ };
44
+
45
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9leHRlbmRXZWJwYWNrQ29uZmlnLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgU2FuaXRpemVkQ29uZmlnIH0gZnJvbSAncGF5bG9hZC9jb25maWcnXG5cbmltcG9ydCBwYXRoIGZyb20gJ3BhdGgnXG5cbmV4cG9ydCBjb25zdCB3ZWJwYWNrID0gKGNvbmZpZykgPT4ge1xuICBjb25zdCBhbGlhc1BhdGggPSBwYXRoLnJlc29sdmUoX19kaXJuYW1lLCAnLi4vbW9jay5qcycpXG5cbiAgcmV0dXJuIHtcbiAgICAuLi5jb25maWcsXG4gICAgcmVzb2x2ZToge1xuICAgICAgLi4uKGNvbmZpZy5yZXNvbHZlIHx8IHt9KSxcbiAgICAgIGFsaWFzOiB7XG4gICAgICAgIC4uLihjb25maWcucmVzb2x2ZT8uYWxpYXMgfHwge30pLFxuICAgICAgICAnQHBheWxvYWRjbXMvZGItcG9zdGdyZXMnOiBhbGlhc1BhdGgsXG4gICAgICB9LFxuICAgIH0sXG4gIH1cbn1cblxuZXhwb3J0IGNvbnN0IGV4dGVuZFdlYnBhY2tDb25maWcgPSAoY29uZmlnOiBTYW5pdGl6ZWRDb25maWcpID0+IHtcbiAgY29uc3QgZXhpc3RpbmdXZWJwYWNrQ29uZmlnID0gY29uZmlnLmFkbWluLndlYnBhY2tcbiAgICA/IGNvbmZpZy5hZG1pbi53ZWJwYWNrXG4gICAgOiAod2VicGFja0NvbmZpZykgPT4gd2VicGFja0NvbmZpZ1xuXG4gIGNvbmZpZy5hZG1pbi53ZWJwYWNrID0gKHdlYnBhY2tDb25maWcpID0+IHtcbiAgICByZXR1cm4gd2VicGFjayhleGlzdGluZ1dlYnBhY2tDb25maWcod2VicGFja0NvbmZpZykpXG4gIH1cbn1cbiJdLCJuYW1lcyI6WyJ3ZWJwYWNrIiwiZXh0ZW5kV2VicGFja0NvbmZpZyIsImNvbmZpZyIsImFsaWFzUGF0aCIsInBhdGgiLCJyZXNvbHZlIiwiX19kaXJuYW1lIiwiYWxpYXMiLCJleGlzdGluZ1dlYnBhY2tDb25maWciLCJhZG1pbiIsIndlYnBhY2tDb25maWciXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7O0lBSWFBLE9BQU87ZUFBUEE7O0lBZUFDLG1CQUFtQjtlQUFuQkE7Ozs2REFqQkk7Ozs7OztBQUVWLE1BQU1ELFVBQVUsQ0FBQ0U7SUFDdEIsTUFBTUMsWUFBWUMsYUFBSSxDQUFDQyxPQUFPLENBQUNDLFdBQVc7SUFFMUMsT0FBTztRQUNMLEdBQUdKLE1BQU07UUFDVEcsU0FBUztZQUNQLEdBQUlILE9BQU9HLE9BQU8sSUFBSSxDQUFDLENBQUM7WUFDeEJFLE9BQU87Z0JBQ0wsR0FBSUwsT0FBT0csT0FBTyxFQUFFRSxTQUFTLENBQUMsQ0FBQztnQkFDL0IsMkJBQTJCSjtZQUM3QjtRQUNGO0lBQ0Y7QUFDRjtBQUVPLE1BQU1GLHNCQUFzQixDQUFDQztJQUNsQyxNQUFNTSx3QkFBd0JOLE9BQU9PLEtBQUssQ0FBQ1QsT0FBTyxHQUM5Q0UsT0FBT08sS0FBSyxDQUFDVCxPQUFPLEdBQ3BCLENBQUNVLGdCQUFrQkE7SUFFdkJSLE9BQU9PLEtBQUssQ0FBQ1QsT0FBTyxHQUFHLENBQUNVO1FBQ3RCLE9BQU9WLFFBQVFRLHNCQUFzQkU7SUFDdkM7QUFDRiJ9
@@ -0,0 +1,13 @@
1
+ import type { DBQueryConfig } from 'drizzle-orm';
2
+ import type { Field } from 'payload/types';
3
+ import type { PostgresAdapter } from '../types';
4
+ type BuildFindQueryArgs = {
5
+ adapter: PostgresAdapter;
6
+ depth: number;
7
+ fields: Field[];
8
+ tableName: string;
9
+ };
10
+ export type Result = DBQueryConfig<'many', true, any, any>;
11
+ export declare const buildFindManyArgs: ({ adapter, depth, fields, tableName, }: BuildFindQueryArgs) => Record<string, unknown>;
12
+ export {};
13
+ //# sourceMappingURL=buildFindManyArgs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildFindManyArgs.d.ts","sourceRoot":"","sources":["../../src/find/buildFindManyArgs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI/C,KAAK,kBAAkB,GAAG;IACxB,OAAO,EAAE,eAAe,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAI1D,eAAO,MAAM,iBAAiB,2CAK3B,kBAAkB,KAAG,OAAO,MAAM,EAAE,OAAO,CAiD7C,CAAA"}
@@ -0,0 +1,15 @@
1
+ export type ChainedMethods = {
2
+ args: unknown[];
3
+ method: string;
4
+ }[];
5
+ /**
6
+ * Call and returning methods that would normally be chained together but cannot be because of control logic
7
+ * @param methods
8
+ * @param query
9
+ */
10
+ declare const chainMethods: ({ methods, query }: {
11
+ methods: any;
12
+ query: any;
13
+ }) => Promise<unknown>;
14
+ export { chainMethods };
15
+ //# sourceMappingURL=chainMethods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chainMethods.d.ts","sourceRoot":"","sources":["../../src/find/chainMethods.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACf,EAAE,CAAA;AAEH;;;;GAIG;AACH,QAAA,MAAM,YAAY;;;MAAyB,QAAQ,OAAO,CAIzD,CAAA;AAED,OAAO,EAAE,YAAY,EAAE,CAAA"}