@payloadcms/db-postgres 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. package/dist/connect.js +1 -1
  2. package/dist/create.d.ts.map +1 -1
  3. package/dist/create.js +7 -9
  4. package/dist/createGlobal.d.ts +1 -1
  5. package/dist/createGlobal.d.ts.map +1 -1
  6. package/dist/createGlobal.js +8 -10
  7. package/dist/createGlobalVersion.d.ts +1 -1
  8. package/dist/createGlobalVersion.d.ts.map +1 -1
  9. package/dist/createGlobalVersion.js +12 -14
  10. package/dist/createMigration.js +1 -1
  11. package/dist/createVersion.d.ts.map +1 -1
  12. package/dist/createVersion.js +22 -19
  13. package/dist/deleteMany.js +6 -8
  14. package/dist/deleteOne.d.ts.map +1 -1
  15. package/dist/deleteOne.js +6 -3
  16. package/dist/deleteVersions.d.ts.map +1 -1
  17. package/dist/deleteVersions.js +7 -8
  18. package/dist/destroy.js +1 -1
  19. package/dist/find/buildFindManyArgs.js +3 -3
  20. package/dist/find/chainMethods.js +1 -1
  21. package/dist/find/findMany.js +2 -2
  22. package/dist/find/traverseFields.d.ts.map +1 -1
  23. package/dist/find/traverseFields.js +23 -11
  24. package/dist/find.d.ts.map +1 -1
  25. package/dist/find.js +10 -11
  26. package/dist/findGlobal.d.ts.map +1 -1
  27. package/dist/findGlobal.js +7 -9
  28. package/dist/findGlobalVersions.d.ts.map +1 -1
  29. package/dist/findGlobalVersions.js +7 -8
  30. package/dist/findOne.d.ts +1 -1
  31. package/dist/findOne.d.ts.map +1 -1
  32. package/dist/findOne.js +9 -10
  33. package/dist/findVersions.d.ts.map +1 -1
  34. package/dist/findVersions.js +7 -8
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +5 -1
  37. package/dist/init.d.ts.map +1 -1
  38. package/dist/init.js +28 -15
  39. package/dist/migrate.js +1 -1
  40. package/dist/migrateDown.js +1 -1
  41. package/dist/migrateFresh.js +1 -1
  42. package/dist/migrateRefresh.js +1 -1
  43. package/dist/migrateReset.js +1 -1
  44. package/dist/migrateStatus.js +1 -1
  45. package/dist/queries/buildAndOrConditions.js +1 -1
  46. package/dist/queries/buildQuery.js +1 -1
  47. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.js +1 -1
  48. package/dist/queries/createJSONQuery/formatJSONPathSegment.js +1 -1
  49. package/dist/queries/createJSONQuery/index.js +1 -1
  50. package/dist/queries/getTableColumnFromPath.d.ts.map +1 -1
  51. package/dist/queries/getTableColumnFromPath.js +148 -42
  52. package/dist/queries/operatorMap.js +1 -1
  53. package/dist/queries/parseParams.js +1 -1
  54. package/dist/queries/sanitizeQueryValue.d.ts.map +1 -1
  55. package/dist/queries/sanitizeQueryValue.js +5 -2
  56. package/dist/queries/selectDistinct.js +1 -1
  57. package/dist/queryDrafts.d.ts.map +1 -1
  58. package/dist/queryDrafts.js +7 -8
  59. package/dist/schema/build.d.ts +2 -1
  60. package/dist/schema/build.d.ts.map +1 -1
  61. package/dist/schema/build.js +19 -14
  62. package/dist/schema/createIndex.js +1 -1
  63. package/dist/schema/getTableName.d.ts +32 -0
  64. package/dist/schema/getTableName.d.ts.map +1 -0
  65. package/dist/schema/getTableName.js +43 -0
  66. package/dist/schema/idToUUID.js +1 -1
  67. package/dist/schema/parentIDColumnMap.js +1 -1
  68. package/dist/schema/setColumnID.js +1 -1
  69. package/dist/schema/traverseFields.d.ts +2 -1
  70. package/dist/schema/traverseFields.d.ts.map +1 -1
  71. package/dist/schema/traverseFields.js +55 -17
  72. package/dist/schema/validateExistingBlockIsIdentical.d.ts +2 -1
  73. package/dist/schema/validateExistingBlockIsIdentical.d.ts.map +1 -1
  74. package/dist/schema/validateExistingBlockIsIdentical.js +12 -6
  75. package/dist/transactions/beginTransaction.js +1 -1
  76. package/dist/transactions/commitTransaction.js +1 -1
  77. package/dist/transactions/rollbackTransaction.js +1 -1
  78. package/dist/transform/read/hasManyNumber.js +1 -1
  79. package/dist/transform/read/hasManyText.js +1 -1
  80. package/dist/transform/read/index.js +1 -1
  81. package/dist/transform/read/relationship.js +1 -1
  82. package/dist/transform/read/traverseFields.js +1 -1
  83. package/dist/transform/write/array.js +1 -1
  84. package/dist/transform/write/blocks.d.ts +2 -2
  85. package/dist/transform/write/blocks.d.ts.map +1 -1
  86. package/dist/transform/write/blocks.js +4 -4
  87. package/dist/transform/write/index.js +1 -1
  88. package/dist/transform/write/numbers.js +1 -1
  89. package/dist/transform/write/relationships.js +1 -1
  90. package/dist/transform/write/selects.js +1 -1
  91. package/dist/transform/write/texts.js +1 -1
  92. package/dist/transform/write/traverseFields.d.ts +2 -2
  93. package/dist/transform/write/traverseFields.d.ts.map +1 -1
  94. package/dist/transform/write/traverseFields.js +34 -25
  95. package/dist/transform/write/types.js +1 -1
  96. package/dist/types.d.ts +13 -0
  97. package/dist/types.d.ts.map +1 -1
  98. package/dist/types.js +1 -1
  99. package/dist/update.d.ts.map +1 -1
  100. package/dist/update.js +7 -4
  101. package/dist/updateGlobal.d.ts +1 -1
  102. package/dist/updateGlobal.d.ts.map +1 -1
  103. package/dist/updateGlobal.js +9 -11
  104. package/dist/updateGlobalVersion.d.ts.map +1 -1
  105. package/dist/updateGlobalVersion.js +9 -5
  106. package/dist/updateVersion.d.ts.map +1 -1
  107. package/dist/updateVersion.js +9 -5
  108. package/dist/upsertRow/deleteExistingArrayRows.js +1 -1
  109. package/dist/upsertRow/deleteExistingRowsByPath.js +1 -1
  110. package/dist/upsertRow/index.d.ts.map +1 -1
  111. package/dist/upsertRow/index.js +7 -6
  112. package/dist/upsertRow/insertArrays.d.ts.map +1 -1
  113. package/dist/upsertRow/insertArrays.js +3 -3
  114. package/dist/upsertRow/types.d.ts +1 -1
  115. package/dist/upsertRow/types.d.ts.map +1 -1
  116. package/dist/upsertRow/types.js +1 -1
  117. package/dist/utilities/appendPrefixToKeys.js +1 -1
  118. package/dist/utilities/createBlocksMap.js +1 -1
  119. package/dist/utilities/createMigrationTable.js +1 -1
  120. package/dist/utilities/createRelationshipMap.js +1 -1
  121. package/dist/utilities/hasLocalesTable.js +1 -1
  122. package/dist/utilities/isArrayOfRows.js +1 -1
  123. package/dist/utilities/migrationTableExists.js +1 -1
  124. package/dist/utilities/parseError.js +1 -1
  125. package/package.json +2 -2
package/dist/connect.js CHANGED
@@ -130,4 +130,4 @@ const connect = async function connect(payload) {
130
130
  }
131
131
  };
132
132
 
133
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jb25uZWN0LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgUGF5bG9hZCB9IGZyb20gJ3BheWxvYWQnXG5pbXBvcnQgdHlwZSB7IENvbm5lY3QgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuXG5pbXBvcnQgeyBlcSwgc3FsIH0gZnJvbSAnZHJpenpsZS1vcm0nXG5pbXBvcnQgeyBkcml6emxlIH0gZnJvbSAnZHJpenpsZS1vcm0vbm9kZS1wb3N0Z3JlcydcbmltcG9ydCB7IG51bWVyaWMsIHRpbWVzdGFtcCwgdmFyY2hhciB9IGZyb20gJ2RyaXp6bGUtb3JtL3BnLWNvcmUnXG5pbXBvcnQgeyBQb29sIH0gZnJvbSAncGcnXG5pbXBvcnQgcHJvbXB0cyBmcm9tICdwcm9tcHRzJ1xuXG5pbXBvcnQgdHlwZSB7IFBvc3RncmVzQWRhcHRlciB9IGZyb20gJy4vdHlwZXMnXG5cbmNvbnN0IGNvbm5lY3RXaXRoUmVjb25uZWN0ID0gYXN5bmMgZnVuY3Rpb24gKHtcbiAgYWRhcHRlcixcbiAgcGF5bG9hZCxcbiAgcmVjb25uZWN0ID0gZmFsc2UsXG59OiB7XG4gIGFkYXB0ZXI6IFBvc3RncmVzQWRhcHRlclxuICBwYXlsb2FkOiBQYXlsb2FkXG4gIHJlY29ubmVjdD86IGJvb2xlYW5cbn0pIHtcbiAgbGV0IHJlc3VsdFxuXG4gIGlmICghcmVjb25uZWN0KSB7XG4gICAgcmVzdWx0ID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sbUJBQW1CLElBQUksQ0FBQ0MsUUFBUSxDQUFDQyxLQUFLLENBQUMsc0JBQXNCO1FBQ2pFTixNQUFNTyxJQUFBQSxlQUFPLEVBQUM7UUFDZEMsT0FBT0MsSUFBQUEsZUFBTyxFQUFDO1FBQ2ZDLFlBQVlDLElBQUFBLGlCQUFTLEVBQUM7UUFDdEJDLFlBQVlELElBQUFBLGlCQUFTLEVBQUM7SUFDeEI7SUFFQSxNQUFNRSxVQUFVLE1BQU0sSUFBSSxDQUFDdEMsT0FBTyxDQUMvQnVDLE1BQU0sR0FDTkMsSUFBSSxDQUFDWCxrQkFDTFksS0FBSyxDQUFDQyxJQUFBQSxjQUFFLEVBQUNiLGlCQUFpQkksS0FBSyxFQUFFO0lBRXBDLElBQUksQ0FBQ0ssUUFBUWxCLE1BQU0sRUFBRTtRQUNuQixNQUFNLElBQUksQ0FBQ3BCLE9BQU8sQ0FBQzJDLE1BQU0sQ0FBQ2Qsa0JBQWtCZSxNQUFNLENBQUM7WUFDakRuQixNQUFNO1lBQ05RLE9BQU87UUFDVDtJQUNGLE9BQU87UUFDTCxNQUFNLElBQUksQ0FBQ2pDLE9BQU8sQ0FDZjZDLE1BQU0sQ0FBQ2hCLGtCQUNQaUIsR0FBRyxDQUFDO1lBQ0hULFlBQVksSUFBSVU7UUFDbEIsR0FDQ04sS0FBSyxDQUFDQyxJQUFBQSxjQUFFLEVBQUNiLGlCQUFpQkksS0FBSyxFQUFFO0lBQ3RDO0FBQ0YifQ==
@@ -1 +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,MAkBpB,CAAA"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAO9C,eAAO,MAAM,MAAM,EAAE,MAqBpB,CAAA"}
package/dist/create.js CHANGED
@@ -8,13 +8,8 @@ Object.defineProperty(exports, "create", {
8
8
  return create;
9
9
  }
10
10
  });
11
- const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
11
+ const _getTableName = require("./schema/getTableName");
12
12
  const _upsertRow = require("./upsertRow");
13
- function _interop_require_default(obj) {
14
- return obj && obj.__esModule ? obj : {
15
- default: obj
16
- };
17
- }
18
13
  const create = async function create({ collection: collectionSlug, data, req }) {
19
14
  const db = this.sessions[req.transactionID]?.db || this.drizzle;
20
15
  const collection = this.payload.collections[collectionSlug].config;
@@ -24,10 +19,13 @@ const create = async function create({ collection: collectionSlug, data, req })
24
19
  db,
25
20
  fields: collection.fields,
26
21
  operation: 'create',
27
- tableName: (0, _tosnakecase.default)(collectionSlug),
28
- req
22
+ req,
23
+ tableName: (0, _getTableName.getTableName)({
24
+ adapter: this,
25
+ config: collection
26
+ })
29
27
  });
30
28
  return result;
31
29
  };
32
30
 
33
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jcmVhdGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBDcmVhdGUgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuXG5pbXBvcnQgdG9TbmFrZUNhc2UgZnJvbSAndG8tc25ha2UtY2FzZSdcblxuaW1wb3J0IHR5cGUgeyBQb3N0Z3Jlc0FkYXB0ZXIgfSBmcm9tICcuL3R5cGVzJ1xuXG5pbXBvcnQgeyB1cHNlcnRSb3cgfSBmcm9tICcuL3Vwc2VydFJvdydcblxuZXhwb3J0IGNvbnN0IGNyZWF0ZTogQ3JlYXRlID0gYXN5bmMgZnVuY3Rpb24gY3JlYXRlKFxuICB0aGlzOiBQb3N0Z3Jlc0FkYXB0ZXIsXG4gIHsgY29sbGVjdGlvbjogY29sbGVjd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NQyxTQUFTLE1BQU1DLElBQUFBLG9CQUFTLEVBQUM7UUFDN0JDLFNBQVMsSUFBSTtRQUNiWDtRQUNBRTtRQUNBVSxRQUFRZCxXQUFXYyxNQUFNO1FBQ3pCQyxXQUFXO1FBQ1haO1FBQ0FhLFdBQVdDLElBQUFBLDBCQUFZLEVBQUM7WUFDdEJKLFNBQVMsSUFBSTtZQUNiSCxRQUFRVjtRQUNWO0lBQ0Y7SUFFQSxPQUFPVztBQUNUIn0=
@@ -1,5 +1,5 @@
1
1
  import type { CreateGlobalArgs } from 'payload/database';
2
2
  import type { TypeWithID } from 'payload/types';
3
3
  import type { PostgresAdapter } from './types';
4
- export declare function createGlobal<T extends TypeWithID>(this: PostgresAdapter, { data, req, slug }: CreateGlobalArgs): Promise<T>;
4
+ export declare function createGlobal<T extends TypeWithID>(this: PostgresAdapter, { slug, data, req }: CreateGlobalArgs): Promise<T>;
5
5
  //# sourceMappingURL=createGlobal.d.ts.map
@@ -1 +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,CAeZ"}
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;AAE/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAK9C,wBAAsB,YAAY,CAAC,CAAC,SAAS,UAAU,EACrD,IAAI,EAAE,eAAe,EACrB,EAAE,IAAI,EAAE,IAAI,EAAE,GAA0B,EAAE,EAAE,gBAAgB,GAC3D,OAAO,CAAC,CAAC,CAAC,CAkBZ"}
@@ -8,14 +8,9 @@ Object.defineProperty(exports, "createGlobal", {
8
8
  return createGlobal;
9
9
  }
10
10
  });
11
- const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
11
+ const _getTableName = require("./schema/getTableName");
12
12
  const _upsertRow = require("./upsertRow");
13
- function _interop_require_default(obj) {
14
- return obj && obj.__esModule ? obj : {
15
- default: obj
16
- };
17
- }
18
- async function createGlobal({ data, req = {}, slug }) {
13
+ async function createGlobal({ slug, data, req = {} }) {
19
14
  const db = this.sessions[req.transactionID]?.db || this.drizzle;
20
15
  const globalConfig = this.payload.globals.config.find((config)=>config.slug === slug);
21
16
  const result = await (0, _upsertRow.upsertRow)({
@@ -24,10 +19,13 @@ async function createGlobal({ data, req = {}, slug }) {
24
19
  db,
25
20
  fields: globalConfig.fields,
26
21
  operation: 'create',
27
- tableName: (0, _tosnakecase.default)(slug),
28
- req
22
+ req,
23
+ tableName: (0, _getTableName.getTableName)({
24
+ adapter: this,
25
+ config: globalConfig
26
+ })
29
27
  });
30
28
  return result;
31
29
  }
32
30
 
33
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jcmVhdGVHbG9iYWwudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBDcmVhdGVHbG9iYWxBcmdzIH0gZnJvbSAncGF5bG9hZC9kYXRhYmFzZSdcbmltcG9ydCB0eXBlIHsgUGF5bG9hZFJlcXVlc3QsIFR5cGVXaXRoSUQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgdG9Tb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Q29uZmlnIiwicGF5bG9hZCIsImdsb2JhbHMiLCJjb25maWciLCJmaW5kIiwicmVzdWx0IiwidXBzZXJ0Um93IiwiYWRhcHRlciIsImZpZWxkcyIsIm9wZXJhdGlvbiIsInRhYmxlTmFtZSIsImdldFRhYmxlTmFtZSJdLCJyYW5nZU1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OyIsIm1hcHBpbmdzIjoiOzs7OytCQVFzQkE7OztlQUFBQTs7OzhCQUhPOzJCQUNIO0FBRW5CLGVBQWVBLGFBRXBCLEVBQUVDLElBQUksRUFBRUMsSUFBSSxFQUFFQyxNQUFNLENBQUMsQ0FBbUIsRUFBb0I7SUFFNUQsTUFBTUMsS0FBSyxJQUFJLENBQUNDLFFBQVEsQ0FBQ0YsSUFBSUcsYUFBYSxDQUFDLEVBQUVGLE1BQU0sSUFBSSxDQUFDRyxPQUFPO0lBQy9ELE1BQU1DLGVBQWUsSUFBSSxDQUFDQyxPQUFPLENBQUNDLE9BQU8sQ0FBQ0MsTUFBTSxDQUFDQyxJQUFJLENBQUMsQ0FBQ0QsU0FBV0EsT0FBT1YsSUFBSSxLQUFLQTtJQUVsRixNQUFNWSxTQUFTLE1BQU1DLElBQUFBLG9CQUFTLEVBQUk7UUFDaENDLFNBQVMsSUFBSTtRQUNiYjtRQUNBRTtRQUNBWSxRQUFRUixhQUFhUSxNQUFNO1FBQzNCQyxXQUFXO1FBQ1hkO1FBQ0FlLFdBQVdDLElBQUFBLDBCQUFZLEVBQUM7WUFDdEJKLFNBQVMsSUFBSTtZQUNiSixRQUFRSDtRQUNWO0lBQ0Y7SUFFQSxPQUFPSztBQUNUIn0=
@@ -1,6 +1,6 @@
1
1
  import type { TypeWithVersion } from 'payload/database';
2
- import { type CreateGlobalVersionArgs } from 'payload/database';
3
2
  import type { TypeWithID } from 'payload/types';
3
+ import { type CreateGlobalVersionArgs } from 'payload/database';
4
4
  import type { PostgresAdapter } from './types';
5
5
  export declare function createGlobalVersion<T extends TypeWithID>(this: PostgresAdapter, { autosave, globalSlug, req, versionData }: CreateGlobalVersionArgs): Promise<TypeWithVersion<T>>;
6
6
  //# sourceMappingURL=createGlobalVersion.d.ts.map
@@ -1 +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,EAAE,KAAK,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,KAAK,EAAkB,UAAU,EAAE,MAAM,eAAe,CAAA;AAM/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,+BAgC3F"}
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;AAG/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAK9C,wBAAsB,mBAAmB,CAAC,CAAC,SAAS,UAAU,EAC5D,IAAI,EAAE,eAAe,EACrB,EAAE,QAAQ,EAAE,UAAU,EAAE,GAA0B,EAAE,WAAW,EAAE,EAAE,uBAAuB,+BAmC3F"}
@@ -10,18 +10,16 @@ Object.defineProperty(exports, "createGlobalVersion", {
10
10
  });
11
11
  const _drizzleorm = require("drizzle-orm");
12
12
  const _versions = require("payload/versions");
13
- const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
13
+ const _getTableName = require("./schema/getTableName");
14
14
  const _upsertRow = require("./upsertRow");
15
- function _interop_require_default(obj) {
16
- return obj && obj.__esModule ? obj : {
17
- default: obj
18
- };
19
- }
20
15
  async function createGlobalVersion({ autosave, globalSlug, req = {}, versionData }) {
21
16
  const db = this.sessions[req.transactionID]?.db || this.drizzle;
22
17
  const global = this.payload.globals.config.find(({ slug })=>slug === globalSlug);
23
- const globalTableName = (0, _tosnakecase.default)(globalSlug);
24
- const tableName = `_${globalTableName}_v`;
18
+ const tableName = (0, _getTableName.getTableName)({
19
+ adapter: this,
20
+ config: global,
21
+ versions: true
22
+ });
25
23
  const result = await (0, _upsertRow.upsertRow)({
26
24
  adapter: this,
27
25
  data: {
@@ -32,18 +30,18 @@ async function createGlobalVersion({ autosave, globalSlug, req = {}, versionData
32
30
  db,
33
31
  fields: (0, _versions.buildVersionGlobalFields)(global),
34
32
  operation: 'create',
35
- tableName,
36
- req
33
+ req,
34
+ tableName
37
35
  });
38
36
  const table = this.tables[tableName];
39
37
  if (global.versions.drafts) {
40
38
  await db.execute((0, _drizzleorm.sql)`
41
- UPDATE ${table}
42
- SET latest = false
43
- WHERE ${table.id} != ${result.id};
39
+ UPDATE ${table}
40
+ SET latest = false
41
+ WHERE ${table.id} != ${result.id};
44
42
  `);
45
43
  }
46
44
  return result;
47
45
  }
48
46
 
49
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jcmVhdGVHbG9iYWxWZXJzaW9uLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgVHlwZVdpdGhWZXJzaW9uIH0gZnJvbSAncGF5bG9hZC9kYXRhYmFzZSdcbmltcG9ydCB7IHR5cGUgQ3JlYXRlR2xvYmFsVmVyc2lvbkFyZ3MgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuaW1wb3J0IHR5cGUgeyB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UM3QkMsU0FBUyxJQUFJO1FBQ2JMLFFBQVFIO1FBQ1JTLFVBQVU7SUFDWjtJQUVBLE1BQU1DLFNBQVMsTUFBTUMsSUFBQUEsb0JBQVMsRUFBcUI7UUFDakRILFNBQVMsSUFBSTtRQUNiSSxNQUFNO1lBQ0pwQjtZQUNBcUIsUUFBUTtZQUNSQyxTQUFTbkI7UUFDWDtRQUNBQztRQUNBbUIsUUFBUUMsSUFBQUEsa0NBQXdCLEVBQUNoQjtRQUNqQ2lCLFdBQVc7UUFDWHZCO1FBQ0FZO0lBQ0Y7SUFFQSxNQUFNWSxRQUFRLElBQUksQ0FBQ0MsTUFBTSxDQUFDYixVQUFVO0lBRXBDLElBQUlOLE9BQU9TLFFBQVEsQ0FBQ1csTUFBTSxFQUFFO1FBQzFCLE1BQU14QixHQUFHeUIsT0FBTyxDQUFDQyxJQUFBQSxlQUFHLENBQUEsQ0FBQztlQUNWLEVBQUVKLE1BQU07O2NBRVQsRUFBRUEsTUFBTUssRUFBRSxDQUFDLElBQUksRUFBRWIsT0FBT2EsRUFBRSxDQUFDO0lBQ3JDLENBQUM7SUFDSDtJQUVBLE9BQU9iO0FBQ1QifQ==
@@ -92,4 +92,4 @@ const createMigration = async function createMigration({ forceAcceptWarning, mig
92
92
  });
93
93
  };
94
94
 
95
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jcmVhdGVNaWdyYXRpb24udHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tcmVzdHJpY3RlZC1zeW50YXgsIG5vLWF3YWl0LWluLWxvb3AgKi9cbmltcG9ydCB0eXBlIHsgRHJpenpsZVNuYXBzaG90SlNPTiB9IGZyb20gJ2RyaXp6bGUta2l0L3BheWxvYWQnXG5pbXBvcnQgdHlwZSB7IENyZWF0ZU1pZ3JhdGlvbiB9IGZyb20gJ3BheWxvYWQvZGF0YWJhc2UnXG5cbmltc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1FBR0YsSUFBSSxDQUFDUiw0QkFBNEI7WUFDL0JPLFFBQVFDLElBQUksQ0FBQztRQUNmO0lBQ0Y7SUFFQSxlQUFlO0lBQ2YzQyxXQUFFLENBQUM0QyxhQUFhLENBQUMsQ0FBQyxFQUFFNUIsU0FBUyxLQUFLLENBQUMsRUFBRVUsS0FBS21CLFNBQVMsQ0FBQ2hCLGtCQUFrQixNQUFNO0lBRTVFLGtCQUFrQjtJQUNsQjdCLFdBQUUsQ0FBQzRDLGFBQWEsQ0FDZCxDQUFDLEVBQUU1QixTQUFTLEdBQUcsQ0FBQyxFQUNoQm5DLGtCQUNFa0QsZ0JBQWdCRSxNQUFNLEdBQUdGLGlCQUFpQmUsS0FBSyxRQUFRQyxXQUN2RGYsa0JBQWtCQyxNQUFNLEdBQUdELG1CQUFtQmMsS0FBSyxRQUFRQztJQUcvRG5ELFFBQVFvRCxNQUFNLENBQUNDLElBQUksQ0FBQztRQUFFQyxLQUFLLENBQUMscUJBQXFCLEVBQUVsQyxTQUFTLEdBQUcsQ0FBQztJQUFDO0FBQ25FIn0=
@@ -1 +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,+BAsCxB"}
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;AAK/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAK9C,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,+BAiDxB"}
@@ -10,18 +10,16 @@ Object.defineProperty(exports, "createVersion", {
10
10
  });
11
11
  const _drizzleorm = require("drizzle-orm");
12
12
  const _versions = require("payload/versions");
13
- const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
13
+ const _getTableName = require("./schema/getTableName");
14
14
  const _upsertRow = require("./upsertRow");
15
- function _interop_require_default(obj) {
16
- return obj && obj.__esModule ? obj : {
17
- default: obj
18
- };
19
- }
20
15
  async function createVersion({ autosave, collectionSlug, parent, req = {}, versionData }) {
21
16
  const db = this.sessions[req.transactionID]?.db || this.drizzle;
22
17
  const collection = this.payload.collections[collectionSlug].config;
23
- const collectionTableName = (0, _tosnakecase.default)(collectionSlug);
24
- const tableName = `_${collectionTableName}_v`;
18
+ const tableName = (0, _getTableName.getTableName)({
19
+ adapter: this,
20
+ config: collection,
21
+ versions: true
22
+ });
25
23
  const result = await (0, _upsertRow.upsertRow)({
26
24
  adapter: this,
27
25
  data: {
@@ -33,23 +31,28 @@ async function createVersion({ autosave, collectionSlug, parent, req = {}, versi
33
31
  db,
34
32
  fields: (0, _versions.buildVersionCollectionFields)(collection),
35
33
  operation: 'create',
36
- tableName,
37
- req
34
+ req,
35
+ tableName
38
36
  });
39
37
  const table = this.tables[tableName];
40
- const relationshipsTable = this.tables[`${tableName}_rels`];
38
+ const relationshipsTable = this.tables[(0, _getTableName.getTableName)({
39
+ adapter: this,
40
+ config: collection,
41
+ relationships: true,
42
+ versions: true
43
+ })];
41
44
  if (collection.versions.drafts) {
42
45
  await db.execute((0, _drizzleorm.sql)`
43
- UPDATE ${table}
44
- SET latest = false
45
- FROM ${relationshipsTable}
46
- WHERE ${table.id} = ${relationshipsTable.parent}
47
- AND ${relationshipsTable.path} = ${'parent'}
48
- AND ${relationshipsTable[`${collectionSlug}ID`]} = ${parent}
49
- AND ${table.id} != ${result.id};
46
+ UPDATE ${table}
47
+ SET latest = false
48
+ FROM ${relationshipsTable}
49
+ WHERE ${table.id} = ${relationshipsTable.parent}
50
+ AND ${relationshipsTable.path} = ${'parent'}
51
+ AND ${relationshipsTable[`${collectionSlug}ID`]} = ${parent}
52
+ AND ${table.id} != ${result.id};
50
53
  `);
51
54
  }
52
55
  return result;
53
56
  }
54
57
 
55
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jcmVhdGVWZXJzaW9uLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgQ3JlYXRlVmVyc2lvbkFyZ3MsIFR5cGVXaXRoVmVyc2lvbiB9IGZyb20gJ3BheWxvYWQvZGF0YWJhc2UnXG5pbXBvcnQgdHlwZSB7IFBheWxvYWRSZXF1ZXN0LCBUeXBlV2l0aElEIH0gZnJvbSAncGF5bG9hZC90eXBlcydcblxuaW1wb3J0IHsgc3FsIH0gZnJvbSAnZHJpenpsZS1vcm0nXG5pbXBvcnQgeyBidWlsZFZlcnNpb25Db2xsZWN0aW9uRmllbGRzIH0gZnJvbSAncGF5bG9hZC92ZXJzaW9ucydcbmltcG9ydCB0b1NuYWtlQ2FzZSBmcm9tICd0by1zbmFrZS1jYXNlJ1xuXG5pbXBvcnQgdHlwZSB7IFBvc3RncmVzQWRhcHRlciB9IGZyb20gJy4vdHlwZXMnXG5cbmltcG9ydCB7IHVwc2VydFJvdyB9IGZyb20gJy4vdXBzZXJ0Um93J1xuXG5leHBvcnQgYXN5bmMgZnVuY3R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*#__PURE__*/ _interop_require_default(require("to-snake-case"));
13
12
  const _findMany = require("./find/findMany");
14
- function _interop_require_default(obj) {
15
- return obj && obj.__esModule ? obj : {
16
- default: obj
17
- };
18
- }
13
+ const _getTableName = require("./schema/getTableName");
19
14
  const deleteMany = async function deleteMany({ collection, req = {}, where }) {
20
15
  const db = this.sessions[req.transactionID]?.db || this.drizzle;
21
16
  const collectionConfig = this.payload.collections[collection].config;
22
- const tableName = (0, _tosnakecase.default)(collection);
17
+ const tableName = (0, _getTableName.getTableName)({
18
+ adapter: this,
19
+ config: collectionConfig
20
+ });
23
21
  const result = await (0, _findMany.findMany)({
24
22
  adapter: this,
25
23
  fields: collectionConfig.fields,
@@ -40,4 +38,4 @@ const deleteMany = async function deleteMany({ collection, req = {}, where }) {
40
38
  }
41
39
  };
42
40
 
43
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kZWxldGVNYW55LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgRGVsZXRlTWFueSB9IGZyb20gJ3BheWxvYWQvZGF0YWJhc2UnXG5pbXBvcnQgdHlwZSB7IFBheWxvYWRSZXF1ZXN0IH0gZnJvbSAncGF5bG9hZC90eXBlcydcblxuaW1wb3J0IHsgaW5BcnJheSB9IGZyb20gJ2RyaXp6bGUtb3JtJ1xuaW1wb3J0IHRvU25ha2VDYXNlIGZyb20gJ3RvLXNuYWtlLWNhc2UnXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi90eXBlcydcblxuaW1wb3J0IHsgZmluZE1hbnkgfSBmcm9tICcuL2ZpbmQvZmluZE1hbnknXG5cbmV4cG9ydCBjb25zdCBkZWxldGVNYW55OiBEZWxldGVNYW55ID0gYXN5bmMgZnVuY3Rpb24gZGVsZXRlTWFueShcbiAgdGhpczogUG9zdGdyZXNBZGFwdGVyLFxuICB7IGNvbGxlY3R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FBTSxHQUFHLEdBQUc7UUFDbEIsTUFBTXhCLEdBQUd5QixNQUFNLENBQUMsSUFBSSxDQUFDQyxNQUFNLENBQUNsQixVQUFVLEVBQUVULEtBQUssQ0FBQzRCLElBQUFBLG1CQUFPLEVBQUMsSUFBSSxDQUFDRCxNQUFNLENBQUNsQixVQUFVLENBQUNlLEVBQUUsRUFBRUw7SUFDbkY7QUFDRiJ9
@@ -1 +1 @@
1
- {"version":3,"file":"deleteOne.d.ts","sourceRoot":"","sources":["../src/deleteOne.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAajD,eAAO,MAAM,SAAS,EAAE,SAsDvB,CAAA"}
1
+ {"version":3,"file":"deleteOne.d.ts","sourceRoot":"","sources":["../src/deleteOne.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAajD,eAAO,MAAM,SAAS,EAAE,SAyDvB,CAAA"}
package/dist/deleteOne.js CHANGED
@@ -9,10 +9,10 @@ Object.defineProperty(exports, "deleteOne", {
9
9
  }
10
10
  });
11
11
  const _drizzleorm = require("drizzle-orm");
12
- const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
13
12
  const _buildFindManyArgs = require("./find/buildFindManyArgs");
14
13
  const _buildQuery = /*#__PURE__*/ _interop_require_default(require("./queries/buildQuery"));
15
14
  const _selectDistinct = require("./queries/selectDistinct");
15
+ const _getTableName = require("./schema/getTableName");
16
16
  const _read = require("./transform/read");
17
17
  function _interop_require_default(obj) {
18
18
  return obj && obj.__esModule ? obj : {
@@ -22,7 +22,10 @@ function _interop_require_default(obj) {
22
22
  const deleteOne = async function deleteOne({ collection: collectionSlug, req = {}, where: whereArg }) {
23
23
  const db = this.sessions[req.transactionID]?.db || this.drizzle;
24
24
  const collection = this.payload.collections[collectionSlug].config;
25
- const tableName = (0, _tosnakecase.default)(collectionSlug);
25
+ const tableName = (0, _getTableName.getTableName)({
26
+ adapter: this,
27
+ config: collection
28
+ });
26
29
  let docToDelete;
27
30
  const { joinAliases, joins, selectFields, where } = await (0, _buildQuery.default)({
28
31
  adapter: this,
@@ -71,4 +74,4 @@ const deleteOne = async function deleteOne({ collection: collectionSlug, req = {
71
74
  return result;
72
75
  };
73
76
 
74
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kZWxldGVPbmUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBEZWxldGVPbmUgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuaW1wb3J0IHR5cGUgeyBQYXlsb2FkUmVxdWVzdCB9IGZyb20gJ3BheWxvYWQvdHlwZXMnXG5cbmltcG9ydCB7IGVxIH0gZnJvbSAnZHJpenpsZS1vcm0nXG5pbXBvcnQgdG9TbmFrZUNhc2UgZnJvbSAndG8tc25ha2UtY2FzZSdcblxuaW1wb3J0IHR5cGUgeyBQb3N0Z3Jlc0FkYXB0ZXIgfSBmcm9tICcuL3R5cGVzJ1xuXG5pbXBvcnQgeyBidWlsZEZpbmRNYW55QXJncyB9IGZyb20gJy4vZmluZC9idWlsZEZpbmRNYW55QXJncydcbmltcG9ydCBidWlsZFF1ZXJ5IGZyb20gJy4vcXVlcmllcy9idWlsZFF1ZXJ5J1xuaW1wb3J0IHsgc2VsZWN0RGlzdGluY3QgfSBmcm9tICcuL3F1ZXJpZXMvc2VsZWN0RGlzdGluY3QnXG5pbXBvcnQgeyB0cmFuc2Zvcm0gfSBmcm9tICcuL3RyYW5zZm9ybS9yZWFkJ1xuXG5leHBvcnQgY29uc3QgZGVsZXRlT25lOiBEZWxldGVPbmUgPSBhc3luYyBmdW5jdGlvbiBkZWxldGVPbmUoXG4gIHRoaXM6IFBvc3RncmVzQWRhcHRlcixcbiAgeyBjb2xsZWN0aW9uOiBjb2xsZWN0aW9uU2x1ZywgcmVxID0ge30gY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BCLE1BQU10QjtRQUNOSyxRQUFRcEIsV0FBV29CLE1BQU07SUFDM0I7SUFFQSxNQUFNZixHQUFHaUMsTUFBTSxDQUFDLElBQUksQ0FBQ1AsTUFBTSxDQUFDbkIsVUFBVSxFQUFFVCxLQUFLLENBQUMyQixJQUFBQSxjQUFFLEVBQUMsSUFBSSxDQUFDQyxNQUFNLENBQUNuQixVQUFVLENBQUNlLEVBQUUsRUFBRVosWUFBWVksRUFBRTtJQUUxRixPQUFPUTtBQUNUIn0=
@@ -1 +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"}
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,cAqC5B,CAAA"}
@@ -10,17 +10,16 @@ Object.defineProperty(exports, "deleteVersions", {
10
10
  });
11
11
  const _drizzleorm = require("drizzle-orm");
12
12
  const _versions = require("payload/versions");
13
- const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
14
13
  const _findMany = require("./find/findMany");
15
- function _interop_require_default(obj) {
16
- return obj && obj.__esModule ? obj : {
17
- default: obj
18
- };
19
- }
14
+ const _getTableName = require("./schema/getTableName");
20
15
  const deleteVersions = async function deleteVersion({ collection, locale, req = {}, where: where }) {
21
16
  const db = this.sessions[req.transactionID]?.db || this.drizzle;
22
17
  const collectionConfig = this.payload.collections[collection].config;
23
- const tableName = `_${(0, _tosnakecase.default)(collection)}_v`;
18
+ const tableName = (0, _getTableName.getTableName)({
19
+ adapter: this,
20
+ config: collectionConfig,
21
+ versions: true
22
+ });
24
23
  const fields = (0, _versions.buildVersionCollectionFields)(collectionConfig);
25
24
  const { docs } = await (0, _findMany.findMany)({
26
25
  adapter: this,
@@ -43,4 +42,4 @@ const deleteVersions = async function deleteVersion({ collection, locale, req =
43
42
  return docs;
44
43
  };
45
44
 
46
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kZWxldGVWZXJzaW9ucy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IERlbGV0ZVZlcnNpb25zIH0gZnJvbSAncGF5bG9hZC9kYXRhYmFzZSdcbmltcG9ydCB0eXBlIHsgUGF5bG9hZFJlcXVlc3QsIFNhbml0aXplZENvbGxlY3Rpb25Db25maWcgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyBpbkFycmF5IH0gZnJvbSAnZHJpenpsZS1vcm0nXG5pbXBvcnQgeyBidWlsZFZlcnNpb25Db2xsZWN0aW9uRmllbGRzIH0gZnJvbSAncGF5bG9hZC92ZXJzaW9ucydcbmltcG9ydCB0b1NuYWtlQ2FzZSBmcm9tICd0by1zbmFrZS1jYXNlJ1xuXG5pbXBvcnQgdHlwZSB7IFBvc3RncmVzQWRhcHRlciB9IGZyb20gJy4vdHlwZXMnXG5cbmltcG9ydCB7IGZpbmRNYW55IH0gZnJvbSAnLi9maW5kL2ZpbmRNYW55J1xuXG5leHBvcnQgY29uc3QgZGVsZXRlVmVyc2lvbnM6IERlbGV0ZVZlcnNpb25zID0gYXN5bmMgZnVuY3Rpb24gZGVsZXRlVmVyc2lvbihcbiAgdGhpczogUG9zdGdyZXNBZGFwdGVyLFxuICB7IGNvbGxlY3Rpb24sIGxvY2FsZSwgcmVxID0ge30gYXMgUGF5bG9hZFJlcXVlc3QsIHdoZXJlOiB3aGVyZSB9LFxuKSB7XG4gIGNvbnN0IGRiID0gdGhpcy5zZXNzaW9uc1tyZXEudHJhbnNhY3Rpb25JRF0/LmRiIHx8IHRoaX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FdBQVcsQ0FBQ1YsV0FBVyxDQUFDVyxNQUFNO0lBRS9GLE1BQU1DLFlBQVlDLElBQUFBLDBCQUFZLEVBQUM7UUFDN0JDLFNBQVMsSUFBSTtRQUNiSCxRQUFRSDtRQUNSTyxVQUFVO0lBQ1o7SUFDQSxNQUFNQyxTQUFTQyxJQUFBQSxzQ0FBNEIsRUFBQ1Q7SUFFNUMsTUFBTSxFQUFFVSxJQUFJLEVBQUUsR0FBRyxNQUFNQyxJQUFBQSxrQkFBUSxFQUFDO1FBQzlCTCxTQUFTLElBQUk7UUFDYkU7UUFDQUksT0FBTztRQUNQbkI7UUFDQW9CLE1BQU07UUFDTkMsWUFBWTtRQUNacEI7UUFDQVU7UUFDQVQ7SUFDRjtJQUVBLE1BQU1vQixNQUFNLEVBQUU7SUFFZEwsS0FBS00sT0FBTyxDQUFDLENBQUNDO1FBQ1pGLElBQUlHLElBQUksQ0FBQ0QsSUFBSUUsRUFBRTtJQUNqQjtJQUVBLElBQUlKLElBQUlLLE1BQU0sR0FBRyxHQUFHO1FBQ2xCLE1BQU14QixHQUFHeUIsTUFBTSxDQUFDLElBQUksQ0FBQ0MsTUFBTSxDQUFDbEIsVUFBVSxFQUFFVCxLQUFLLENBQUM0QixJQUFBQSxtQkFBTyxFQUFDLElBQUksQ0FBQ0QsTUFBTSxDQUFDbEIsVUFBVSxDQUFDZSxFQUFFLEVBQUVKO0lBQ25GO0lBRUEsT0FBT0w7QUFDVCJ9
package/dist/destroy.js CHANGED
@@ -13,4 +13,4 @@ const destroy = async function destroy() {
13
13
  // await this.pool.end()
14
14
  };
15
15
 
16
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kZXN0cm95LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgRGVzdHJveSB9IGZyb20gJ3BheWxvYWQvZGF0YWJhc2UnXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZX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QUMxQiJ9
@@ -41,7 +41,7 @@ const buildFindManyArgs = ({ adapter, depth, fields, tableName })=>{
41
41
  ]
42
42
  };
43
43
  }
44
- if (adapter.tables[`${tableName}_rels`]) {
44
+ if (adapter.tables[`${tableName}${adapter.relationshipsSuffix}`]) {
45
45
  result.with._rels = {
46
46
  columns: {
47
47
  id: false,
@@ -52,7 +52,7 @@ const buildFindManyArgs = ({ adapter, depth, fields, tableName })=>{
52
52
  ]
53
53
  };
54
54
  }
55
- if (adapter.tables[`${tableName}_locales`]) {
55
+ if (adapter.tables[`${tableName}${adapter.localesSuffix}`]) {
56
56
  result.with._locales = _locales;
57
57
  }
58
58
  (0, _traverseFields.traverseFields)({
@@ -69,4 +69,4 @@ const buildFindManyArgs = ({ adapter, depth, fields, tableName })=>{
69
69
  return result;
70
70
  };
71
71
 
72
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maW5kL2J1aWxkRmluZE1hbnlBcmdzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgREJRdWVyeUNvbmZpZyB9IGZyb20gJ2RyaXp6bGUtb3JtJ1xuaW1wb3J0IHR5cGUgeyBGaWVsZCB9IGZyb20gJ3BheWxvYWQvdHlwZXMnXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi4vdHlwZXMnXG5cbmltcG9ydCB7IHRyYXZlcnNlRmllbGRzIH0gZnJvbSAnLi90cmF2ZXJzZUZpZWxkcydcblxudHlwZSBCdWlsZEZpbmRRdWVyeUFyZ3MgPSB7XG4gIGFkYXB0ZXI6IFBvc3RncmVzQWRhcHRlclxuICBkZXB0aDogbnVtYmVyXG4gIGZpZWxkczogRmllbGRbXVxuICB0YWJsZU5hbWU6IHN0cmluZ1xufVxuXG5leHBvcnQgdHlwZSBSZXN1bHQgPSBEQlF1ZXJ5Q29uZmlnPCdtYW55JywgdH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BQU9DO0FBQ1QifQ==
@@ -18,4 +18,4 @@ Object.defineProperty(exports, "chainMethods", {
18
18
  }, query);
19
19
  };
20
20
 
21
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maW5kL2NoYWluTWV0aG9kcy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IFF1ZXJ5UHJvbWlzZSB9IGZyb20gJ2RyaXp6bGUtb3JtJ1xuXG5leHBvcnQgdHlwZSBDaGFpbmVkTWV0aG9kcyA9IHtcbiAgYXJnczogdW5rbm93bltdXG4gIG1ldGhvZDogc3RyaW5nXG59W11cblxuLyoqXG4gKiBDYWxsIGFuZCByZXR1cm5pbmcgbWV0aG9kcyB0aGF0IHdvdWxkIG5vcm1hbGx5IGJlIGNoYWluZWQgdG9nZXRoZXIgYnV0IGNhbm5vdCBiZSBiZWNhdXNlIG9mIGNvbnRyb2wgbG9naWNcbiAqIEBwYXJhbSBtZXRob2RzXG4gKiBAcGFyYW0gcXVlcnlcbiAqL1xuY29uc3QgY2hhaW5NZXRob2RzID0gPFQ+KHsgbWV0aG9kcywgcXVlcnkgfSk6IFF1ZXJ5UHJvbWlzZTxUPiA9PiB7XG4gIHJldHVybiBtZXRob2RzLnJlZHVjZSgocXVlcnksIHsgYXJncywgbWV0aG9kIH0pID0+IHtcbiAgICByZXR1cm4gcXVlcnlbbWV0aG9kXSguLi5hcmdzKVxuICB9LCBxdWVyeSlcbn1cblxuZXhwb3J0IHsgY2hhaW5NZXRob2RzIH1cbiJdLCJuYW1lcyI6WyJjaGFpbk1ldGhvZHMiLCJtZXRob2RzIiwicXVlcnkiLCJyZWR1Y2UiLCJhcmdzIiwibWV0aG9kIl0sIm1hcHBpbmdzIjoiOzs7OytCQWtCU0E7OztlQUFBQTs7O0FBWFQ7Ozs7Q0FJQyxHQUNELE1BQU1BLGVBQWUsQ0FBSSxFQUFFQyxPQUFPLEVBQ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