@payloadcms/db-postgres 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. package/dist/find/buildFindManyArgs.d.ts.map +1 -1
  2. package/dist/find/buildFindManyArgs.js +12 -1
  3. package/dist/init.d.ts.map +1 -1
  4. package/dist/init.js +7 -1
  5. package/dist/migrate.d.ts.map +1 -1
  6. package/dist/migrate.js +14 -5
  7. package/dist/migrateDown.d.ts.map +1 -1
  8. package/dist/migrateDown.js +13 -10
  9. package/dist/migrateFresh.d.ts.map +1 -1
  10. package/dist/migrateFresh.js +15 -12
  11. package/dist/migrateRefresh.d.ts.map +1 -1
  12. package/dist/migrateRefresh.js +17 -15
  13. package/dist/migrateReset.d.ts.map +1 -1
  14. package/dist/migrateReset.js +11 -9
  15. package/dist/queries/parseParams.d.ts.map +1 -1
  16. package/dist/queries/parseParams.js +29 -5
  17. package/dist/schema/build.d.ts +3 -1
  18. package/dist/schema/build.d.ts.map +1 -1
  19. package/dist/schema/build.js +58 -17
  20. package/dist/schema/getConfigIDType.d.ts +3 -0
  21. package/dist/schema/getConfigIDType.d.ts.map +1 -0
  22. package/dist/schema/getConfigIDType.js +25 -0
  23. package/dist/schema/traverseFields.d.ts +4 -1
  24. package/dist/schema/traverseFields.d.ts.map +1 -1
  25. package/dist/schema/traverseFields.js +48 -8
  26. package/dist/schema/validateExistingBlockIsIdentical.d.ts.map +1 -1
  27. package/dist/schema/validateExistingBlockIsIdentical.js +49 -7
  28. package/dist/transform/read/hasManyText.d.ts +10 -0
  29. package/dist/transform/read/hasManyText.d.ts.map +1 -0
  30. package/dist/transform/read/hasManyText.js +20 -0
  31. package/dist/transform/read/index.d.ts.map +1 -1
  32. package/dist/transform/read/index.js +7 -1
  33. package/dist/transform/read/traverseFields.d.ts +5 -1
  34. package/dist/transform/read/traverseFields.d.ts.map +1 -1
  35. package/dist/transform/read/traverseFields.js +53 -2
  36. package/dist/transform/write/array.d.ts +2 -1
  37. package/dist/transform/write/array.d.ts.map +1 -1
  38. package/dist/transform/write/array.js +3 -2
  39. package/dist/transform/write/blocks.d.ts +2 -1
  40. package/dist/transform/write/blocks.d.ts.map +1 -1
  41. package/dist/transform/write/blocks.js +3 -2
  42. package/dist/transform/write/index.d.ts.map +1 -1
  43. package/dist/transform/write/index.js +3 -1
  44. package/dist/transform/write/texts.d.ts +8 -0
  45. package/dist/transform/write/texts.d.ts.map +1 -0
  46. package/dist/transform/write/texts.js +21 -0
  47. package/dist/transform/write/traverseFields.d.ts +2 -1
  48. package/dist/transform/write/traverseFields.d.ts.map +1 -1
  49. package/dist/transform/write/traverseFields.js +41 -2
  50. package/dist/transform/write/types.d.ts +1 -0
  51. package/dist/transform/write/types.d.ts.map +1 -1
  52. package/dist/upsertRow/index.d.ts.map +1 -1
  53. package/dist/upsertRow/index.js +28 -1
  54. package/package.json +3 -3
@@ -9,6 +9,9 @@ Object.defineProperty(exports, "migrateReset", {
9
9
  }
10
10
  });
11
11
  const _database = require("payload/database");
12
+ const _commitTransaction = require("payload/dist/utilities/commitTransaction");
13
+ const _initTransaction = require("payload/dist/utilities/initTransaction");
14
+ const _killTransaction = require("payload/dist/utilities/killTransaction");
12
15
  const _migrationTableExists = require("./utilities/migrationTableExists");
13
16
  async function migrateReset() {
14
17
  const { payload } = this;
@@ -24,9 +27,9 @@ async function migrateReset() {
24
27
  });
25
28
  return;
26
29
  }
30
+ const req = {};
27
31
  // Rollback all migrations in order
28
32
  for (const migration of existingMigrations){
29
- let transactionID;
30
33
  const migrationFile = migrationFiles.find((m)=>m.name === migration.name);
31
34
  try {
32
35
  if (!migrationFile) {
@@ -36,9 +39,10 @@ async function migrateReset() {
36
39
  payload.logger.info({
37
40
  msg: `Migrating down: ${migrationFile.name}`
38
41
  });
39
- transactionID = await this.beginTransaction();
42
+ await (0, _initTransaction.initTransaction)(req);
40
43
  await migrationFile.down({
41
- payload
44
+ payload,
45
+ req
42
46
  });
43
47
  payload.logger.info({
44
48
  msg: `Migrated down: ${migrationFile.name} (${Date.now() - start}ms)`
@@ -48,16 +52,14 @@ async function migrateReset() {
48
52
  await payload.delete({
49
53
  id: migration.id,
50
54
  collection: 'payload-migrations',
51
- req: {
52
- transactionID
53
- }
55
+ req
54
56
  });
55
57
  }
56
- await this.commitTransaction(transactionID);
58
+ await (0, _commitTransaction.commitTransaction)(req);
57
59
  } catch (err) {
58
60
  let msg = `Error running migration ${migrationFile.name}.`;
59
61
  if (err instanceof Error) msg += ` ${err.message}`;
60
- await this.rollbackTransaction(transactionID);
62
+ await (0, _killTransaction.killTransaction)(req);
61
63
  payload.logger.error({
62
64
  err,
63
65
  msg
@@ -86,4 +88,4 @@ async function migrateReset() {
86
88
  }
87
89
  }
88
90
 
89
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9taWdyYXRlUmVzZXQudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tcmVzdHJpY3RlZC1zeW50YXgsIG5vLWF3YWl0LWluLWxvb3AgKi9cbmltcG9ydCB0eXBlIHsgUGF5bG9hZFJlcXVlc3QgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyBnZXRNaWdyYXRpb25zLCByZWFkTWlncmF0aW9uRmlsZXMgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuXG5pbXBvcnQgdHlwZSB7IFBvc3RncmVzQWRhcHRlciB9IGZyb20gJy4vdHlwZXMnXG5cbmltcG9ydCB7IG1pZ3JhdGlvblRhYmxlRXhpc3RzIH0gZnJvbSAnLi91dGlsaXRpZXMvbWlncmF0aW9uVGFibGVFeGlzdHMnXG5cbi8qKlxuICogUnVuIGFsbCBtaWdyYXRlIGRvd24gZnVuY3Rpb25zXG4gKi9cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBtaWdyYXRlUmVzZXQodGhpczogUG9zdGdyZXNBZGFwdGVyKTogUHJvbWlzZTx2b2lkPiB7XG4g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Y7UUFDRixFQUFFLE9BQU9SLEtBQWM7WUFDckI1QixRQUFRTSxNQUFNLENBQUN5QixLQUFLLENBQUM7Z0JBQUVBLE9BQU9IO2dCQUFLcEIsS0FBSztZQUErQjtRQUN6RTtJQUNGO0FBQ0YifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"parseParams.d.ts","sourceRoot":"","sources":["../../src/queries/parseParams.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,EAAE,KAAK,EAAY,KAAK,EAAE,MAAM,eAAe,CAAA;AAM3D,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAS1E,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,eAAe,CAAA;IACxB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,WAAW,EAAE,qBAAqB,CAAA;IAClC,KAAK,EAAE,eAAe,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IAC3C,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,KAAK,CAAA;CACb,CAAA;AAED,wBAAsB,WAAW,CAAC,EAChC,OAAO,EACP,MAAM,EACN,WAAW,EACX,KAAK,EACL,MAAM,EACN,YAAY,EACZ,SAAS,EACT,KAAK,GACN,EAAE,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CA6KrB"}
1
+ {"version":3,"file":"parseParams.d.ts","sourceRoot":"","sources":["../../src/queries/parseParams.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,EAAE,KAAK,EAAY,KAAK,EAAE,MAAM,eAAe,CAAA;AAM3D,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAS1E,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,eAAe,CAAA;IACxB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,WAAW,EAAE,qBAAqB,CAAA;IAClC,KAAK,EAAE,eAAe,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IAC3C,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,KAAK,CAAA;CACb,CAAA;AAED,wBAAsB,WAAW,CAAC,EAChC,OAAO,EACP,MAAM,EACN,WAAW,EACX,KAAK,EACL,MAAM,EACN,YAAY,EACZ,SAAS,EACT,KAAK,GACN,EAAE,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAiMrB"}
@@ -79,7 +79,7 @@ async function parseParams({ adapter, fields, joinAliases, joins, locale, select
79
79
  if ([
80
80
  'json',
81
81
  'richText'
82
- ].includes(field.type) && Array.isArray(pathSegments)) {
82
+ ].includes(field.type) && Array.isArray(pathSegments) && pathSegments.length > 1) {
83
83
  const segments = pathSegments.slice(1);
84
84
  segments.unshift(table[columnName].name);
85
85
  if (field.type === 'richText') {
@@ -93,11 +93,35 @@ async function parseParams({ adapter, fields, joinAliases, joins, locale, select
93
93
  value: val
94
94
  });
95
95
  constraints.push(_drizzleorm.sql.raw(jsonQuery));
96
+ break;
96
97
  }
97
- if (field.type === 'json') {
98
- const jsonQuery = (0, _convertPathToJSONTraversal.convertPathToJSONTraversal)(pathSegments);
99
- constraints.push(_drizzleorm.sql.raw(`${table[columnName].name}${jsonQuery} = '%${val}%'`));
98
+ const jsonQuery = (0, _convertPathToJSONTraversal.convertPathToJSONTraversal)(pathSegments);
99
+ const operatorKeys = {
100
+ contains: {
101
+ operator: 'ilike',
102
+ wildcard: '%'
103
+ },
104
+ equals: {
105
+ operator: '=',
106
+ wildcard: ''
107
+ },
108
+ exists: {
109
+ operator: val === true ? 'is not null' : 'is null'
110
+ },
111
+ like: {
112
+ operator: 'like',
113
+ wildcard: '%'
114
+ },
115
+ not_equals: {
116
+ operator: '<>',
117
+ wildcard: ''
118
+ }
119
+ };
120
+ let formattedValue = `'${operatorKeys[operator].wildcard}${val}${operatorKeys[operator].wildcard}'`;
121
+ if (operator === 'exists') {
122
+ formattedValue = '';
100
123
  }
124
+ constraints.push(_drizzleorm.sql.raw(`${table[columnName].name}${jsonQuery} ${operatorKeys[operator].operator} ${formattedValue}`));
101
125
  break;
102
126
  }
103
127
  if (getNotNullColumnByValue) {
@@ -159,4 +183,4 @@ async function parseParams({ adapter, fields, joinAliases, joins, locale, select
159
183
  return result;
160
184
  }
161
185
 
162
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9xdWVyaWVzL3BhcnNlUGFyYW1zLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLWF3YWl0LWluLWxvb3AgKi9cbmltcG9ydCB0eXBlIHsgU1FMIH0gZnJvbSAnZHJpenpsZS1vcm0nXG5pbXBvcnQgdHlwZSB7IEZpZWxkLCBPcGVyYXRvciwgV2hlcmUgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyBhbmQsIGlsaWtlLCBpc05vdE51bGwsIGlzTnVsbCwgbmUsIG5vdEluQXJyYXksIG9yLCBzcWwgfSBmcm9tICdkcml6emxlLW9ybSdcbmltcG9ydCB7IFF1ZXJ5RXJyb3IgfSBmcm9tICdwYXlsb2FkL2Vycm9ycydcbmltcG9ydCB7IHZhbGlkT3BlcmF0b3JzIH0gZnJvbSAncGF5bG9hZC90eXBlcydcblxuaW1wb3J0IHR5cGUgeyBHZW5lcmljQ29sdW1uLCBQb3N0Z3Jlc0FkYXB0ZXIgfSBm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xpYXNlcyxcbiAgICAgICAgICAgIGpvaW5zLFxuICAgICAgICAgICAgbG9jYWxlLFxuICAgICAgICAgICAgc2VsZWN0RmllbGRzLFxuICAgICAgICAgICAgdGFibGVOYW1lLFxuICAgICAgICAgICAgd2hlcmU6IGNvbmRpdGlvbixcbiAgICAgICAgICB9KVxuICAgICAgICAgIGlmIChidWlsdENvbmRpdGlvbnMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgaWYgKHJlc3VsdCkge1xuICAgICAgICAgICAgICByZXN1bHQgPSBvcGVyYXRvck1hcFtjb25kaXRpb25PcGVyYXRvcl0ocmVzdWx0LCAuLi5idWlsdENvbmRpdGlvbnMpXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXN1bHQgPSBvcGVyYXRvck1hcFtjb25kaXRpb25PcGVyYXRvcl0oLi4uYnVpbHRDb25kaXRpb25zKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvLyBJdCdzIGEgcGF0aCAtIGFuZCB0aGVyZSBjYW4gYmUgbXVsdGlwbGUgY29tcGFyaXNvbnMgb24gYSBzaW5nbGUgcGF0aC5cbiAgICAgICAgICAvLyBGb3IgZXhhbXBsZSAtIHRpdGxlIGxpa2UgJ3Rlc3QnIGFuZCB0aXRsZSBub3QgZXF1YWwgdG8gJ3Rlc3RlcidcbiAgICAgICAgICAvLyBTbyB3ZSBuZWVkIHRvIGxvb3Agb24ga2V5cyBhZ2FpbiBoZXJlIHRvIGhhbmRsZSBlYWNoIG9wZXJhdG9yIGluZGVwZW5kZW50bHlcbiAgICAgICAgICBjb25zdCBwYXRoT3BlcmF0b3JzID0gd2hlcmVbcmVsYXRpb25PclBhdGhdXG4gICAgICAgICAgaWYgKHR5cGVvZiBwYXRoT3BlcmF0b3JzID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgZm9yIChjb25zdCBvcGVyYXRvciBvZiBPYmplY3Qua2V5cyhwYXRoT3BlcmF0b3JzKSkge1xuICAgICAgICAgICAgICBpZiAodmFsaWRPcGVyYXRvcnMuaW5jbHVkZXMob3BlcmF0b3IgYXMgT3BlcmF0b3IpKSB7XG4gICAgICAgICAgICAgICAgY29uc3Qge1xuICAgICAgICAgICAgICAgICAgY29sdW1uTmFtZSxcbiAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzOiBxdWVyeUNvbnN0cmFpbnRzLFxuICAgICAgICAgICAgICAgICAgZmllbGQsXG4gICAgICAgICAgICAgICAgICBnZXROb3ROdWxsQ29sdW1uQnlWYWx1ZSxcbiAgICAgICAgICAgICAgICAgIHBhdGhTZWdtZW50cyxcbiAgICAgICAgICAgICAgICAgIHJhd0NvbHVtbixcbiAgICAgICAgICAgICAgICAgIHRhYmxlLFxuICAgICAgICAgICAgICAgIH0gPSBnZXRUYWJsZUNvbHVtbkZyb21QYXRoKHtcbiAgICAgICAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICAgICAgICBjb2xsZWN0aW9uUGF0aDogcmVsYXRpb25PclBhdGgsXG4gICAgICAgICAgICAgICAgICBmaWVsZHMsXG4gICAgICAgICAgICAgICAgICBqb2luQWxpYXNlcyxcbiAgICAgICAgICAgICAgICAgIGpvaW5zLFxuICAgICAgICAgICAgICAgICAgbG9jYWxlLFxuICAgICAgICAgICAgICAgICAgcGF0aFNlZ21lbnRzOiByZWxhdGlvbk9yUGF0aC5yZXBsYWNlKC9fXy9nLCAnLicpLnNwbGl0KCcuJyksXG4gICAgICAgICAgICAgICAgICBzZWxlY3RGaWVsZHMsXG4gICAgICAgICAgICAgICAgICB0YWJsZU5hbWUsXG4gICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgIGNvbnN0IHZhbCA9IHdoZXJlW3JlbGF0aW9uT3JQYXRoXVtvcGVyYXRvcl1cblxuICAgICAgICAgICAgICAgIHF1ZXJ5Q29uc3RyYWludHMuZm9yRWFjaCgoeyBjb2x1bW5OYW1lOiBjb2wsIHRhYmxlOiBjb25zdHJhaW50VGFibGUsIHZhbHVlIH0pID0+IHtcbiAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdmFsdWUgPT09ICdzdHJpbmcnICYmIHZhbHVlLmluZGV4T2YoJyUnKSA+IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLnB1c2gob3BlcmF0b3JNYXAubGlrZShjb25zdHJhaW50VGFibGVbY29sXSwgdmFsdWUpKVxuICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChvcGVyYXRvck1hcC5lcXVhbHMoY29uc3RyYWludFRhYmxlW2NvbF0sIHZhbHVlKSlcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgaWYgKFsnanNvbicsICdyaWNoVGV4dCddLmluY2x1ZGVzKGZpZWxkLnR5cGUpICYmIEFycmF5LmlzQXJyYXkocGF0aFNlZ21lbnRzKSkge1xuICAgICAgICAgICAgICAgICAgY29uc3Qgc2VnbWVudHMgPSBwYXRoU2VnbWVudHMuc2xpY2UoMSlcbiAgICAgICAgICAgICAgICAgIHNlZ21lbnRzLnVuc2hpZnQodGFibGVbY29sdW1uTmFtZV0ubmFtZSlcblxuICAgICAgICAgICAgICAgICAgaWYgKGZpZWxkLnR5cGUgPT09ICdyaWNoVGV4dCcpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QganNvblF1ZXJ5ID0gY3JlYXRlSlNPTlF1ZXJ5KHtcbiAgICAgICAgICAgICAgICAgICAgICBvcGVyYXRvcixcbiAgICAgICAgICAgICAgICAgICAgICBwYXRoU2VnbWVudHM6IHNlZ21lbnRzLFxuICAgICAgICAgICAgICAgICAgICAgIHRyZWF0QXNBcnJheTogWydjaGlsZHJlbiddLFxuICAgICAgICAgICAgICAgICAgICAgIHRyZWF0Um9vdEFzQXJyYXk6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHZhbCxcbiAgICAgICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50cy5wdXNoKHNxbC5yYXcoanNvblF1ZXJ5KSlcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgaWYgKGZpZWxkLnR5cGUgPT09ICdqc29uJykge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBqc29uUXVlcnkgPSBjb252ZXJ0UGF0aFRvSlNPTlRyYXZlcnNhbChwYXRoU2VnbWVudHMpXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLnB1c2goc3FsLnJhdyhgJHt0YWJsZVtjb2x1bW5OYW1lXS5uYW1lfSR7anNvblF1ZXJ5fSA9ICclJHt2YWx9JSdgKSlcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoZ2V0Tm90TnVsbENvbHVtbkJ5VmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0IGNvbHVtbk5hbWUgPSBnZXROb3ROdWxsQ29sdW1uQnlWYWx1ZSh2YWwpXG4gICAgICAgICAgICAgICAgICBpZiAoY29sdW1uTmFtZSkge1xuICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50cy5wdXNoKGlzTm90TnVsbCh0YWJsZVtjb2x1bW5OYW1lXSkpXG4gICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUXVlcnlFcnJvcihbeyBwYXRoOiByZWxhdGlvbk9yUGF0aCB9XSlcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKG9wZXJhdG9yID09PSAnbGlrZScpIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLnB1c2goXG4gICAgICAgICAgICAgICAgICAgIGFuZCguLi52YWwuc3BsaXQoJyAnKS5tYXAoKHdvcmQpID0+IGlsaWtlKHRhYmxlW2NvbHVtbk5hbWVdLCBgJSR7d29yZH0lYCkpKSxcbiAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgY29uc3Qgc2FuaXRpemVkUXVlcnlWYWx1ZSA9IHNhbml0aXplUXVlcnlWYWx1ZSh7XG4gICAgICAgICAgICAgICAgICBmaWVsZCxcbiAgICAgICAgICAgICAgICAgIG9wZXJhdG9yLFxuICAgICAgICAgICAgICAgICAgcmVsYXRpb25PclBhdGgsXG4gICAgICAgICAgICAgICAgICB2YWwsXG4gICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgIGlmIChzYW5pdGl6ZWRRdWVyeVZhbHVlID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGNvbnN0IHsgb3BlcmF0b3I6IHF1ZXJ5T3BlcmF0b3IsIHZhbHVlOiBxdWVyeVZhbHVlIH0gPSBzYW5pdGl6ZWRRdWVyeVZhbHVlXG5cbiAgICAgICAgICAgICAgICBpZiAocXVlcnlPcGVyYXRvciA9PT0gJ25vdF9lcXVhbHMnICYmIHF1ZXJ5VmFsdWUgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLnB1c2goXG4gICAgICAgICAgICAgICAgICAgIG9yKFxuICAgICAgICAgICAgICAgICAgICAgIGlzTnVsbChyYXdDb2x1bW4gfHwgdGFibGVbY29sdW1uTmFtZV0pLFxuICAgICAgICAgICAgICAgICAgICAgIC8qIGVzbGludC1kaXNhYmxlIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnkgKi9cbiAgICAgICAgICAgICAgICAgICAgICBuZTxhbnk+KHJhd0NvbHVtbiB8fCB0YWJsZVtjb2x1bW5OYW1lXSwgcXVlcnlWYWx1ZSksXG4gICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgIChmaWVsZC50eXBlID09PSAncmVsYXRpb25zaGlwJyB8fCBmaWVsZC50eXBlID09PSAndXBsb2FkJykgJiZcbiAgICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkocXVlcnlWYWx1ZSkgJiZcbiAgICAgICAgICAgICAgICAgIG9wZXJhdG9yID09PSAnbm90X2luJ1xuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChcbiAgICAgICAgICAgICAgICAgICAgc3FsYCR7bm90SW5BcnJheSh0YWJsZVtjb2x1bW5OYW1lXSwgcXVlcnlWYWx1ZSl9IE9SXG4gICAgICAgICAgICAgICAgICAgICR7dGFibGVbY29sdW1uTmFtZV19XG4gICAgICAgICAgICAgICAgICAgIElTXG4gICAgICAgICAgICAgICAgICAgIE5VTExgLFxuICAgICAgICAgICAgICAgICAgKVxuXG4gICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLnB1c2goXG4gICAgICAgICAgICAgICAgICBvcGVyYXRvck1hcFtxdWVyeU9wZXJhdG9yXShyYXdDb2x1bW4gfHwgdGFibGVbY29sdW1uTmFtZV0sIHF1ZXJ5VmFsdWUpLFxuICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfVxuICBpZiAoY29uc3RyYWludHM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dXG5cbiAgaWYgKHR5cGVvZiB3aGVyZSA9PT0gJ29iamVjdCcgJiYgT2JqZWN0LmtleXMod2hlcmUpLmxlbmd0aCA+IDApIHtcbiAgICAvLyBXZSBuZWVkIHRvIGRldGVybWluZSBpZiB0aGUgd2hlcmVLZXkgaXMgYW4gQU5ELCBPUiwgb3IgYSBzY2hlbWEgcGF0aFxuICAgIGZvciAoY29uc3QgcmVsYXRpb25PclBhdGggb2YgT2JqZWN0LmtleXMod2hlcmUpKSB7XG4gICAgICBpZiAocmVsYXRpb25PclBhdGgpIHtcbiAgICAgICAgY29uc3QgY29uZGl0aW9uID0gd2hlcmVbcmVsYXRpb25PclBhdGhdXG4gICAgICAgIGxldCBjb25kaXRpb25PcGVyYXRvcjogJ2FuZCcgfCAnb3InXG4gICAgICAgIGlmIChyZWxhdGlvbk9yUGF0aC50b0xvd2VyQ2FzZSgpID09PSAnYW5kJykge1xuICAgICAgICAgIGNvbmRpdGlvbk9wZXJhdG9yID0gJ2FuZCdcbiAgICAgICAgfSBlbHNlIGlmIChyZWxhdGlvbk9yUGF0aC50b0xvd2VyQ2FzZSgpID09PSAnb3InKSB7XG4gICAgICAgICAgY29uZGl0aW9uT3BlcmF0b3IgPSAnb3InXG4gICAgICAgIH1cbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoY29uZGl0aW9uKSkge1xuICAgICAgICAgIGNvbnN0IGJ1aWx0Q29uZGl0aW9ucyA9IGF3YWl0IGJ1aWxkQW5kT3JDb25kaXRpb25zKHtcbiAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICBmaWVsZHMsXG4gICAgICAgICAgICBqb2luQWxpYXNlcyxcbiAgICAgICAgICAgIGpvaW5zLFxuICAgICAgICAgICAgbG9jYWxlLFxuICAgICAgICAgICAgc2VsZWN0RmllbGRzLFxuICAgICAgICAgICAgdGFibGVOYW1lLFxuICAgICAgICAgICAgd2hlcmU6IGNvbmRpdGlvbixcbiAgICAgICAgICB9KVxuICAgIC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biAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzOiBxdWVyeUNvbnN0cmFpbnRzLFxuICAgICAgICAgICAgICAgICAgZmllbGQsXG4gICAgICAgICAgICAgICAgICBnZXROb3ROdWxsQ29sdW1uQnlWYWx1ZSxcbiAgICAgICAgICAgICAgICAgIHBhdGhTZWdtZW50cyxcbiAgICAgICAgICAgICAgICAgIHJhd0NvbHVtbixcbiAgICAgICAgICAgICAgICAgIHRhYmxlLFxuICAgICAgICAgICAgICAgIH0gPSBnZXRUYWJsZUNvbHVtbkZyb21QYXRoKHtcbiAgICAgICAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICAgICAgICBjb2xsZWN0aW9uUGF0aDogcmVsYXRpb25PclBhdGgsXG4gICAgICAgICAgICAgICAgICBmaWVsZHMsXG4gICAgICAgICAgICAgICAgICBqb2luQWxpYXNlcyxcbiAgICAgICAgICAgICAgICAgIGpvaW5zLFxuICAgICAgICAgICAgICAgICAgbG9jYWxlLFxuICAgICAgICAgICAgICAgICAgcGF0aFNlZ21lbnRzOiByZWxhdGlvbk9yUGF0aC5yZXBsYWNlKC9fXy9nLCAnLicpLnNwbGl0KCcuJyksXG4gICAgICAgICAgICAgICAgICBzZWxlY3RGaWVsZHMsXG4gICAgICAgICAgICAgICAgICB0YWJsZU5hbWUsXG4gICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgIGNvbnN0IHZhbCA9IHdoZXJlW3JlbGF0aW9uT3JQYXRoXVtvcGVyYXRvcl1cblxuICAgICAgICAgICAgICAgIHF1ZXJ5Q29uc3RyYWludHMuZm9yRWFjaCgoeyBjb2x1bW5OYW1lOiBjb2wsIHRhYmxlOiBjb25zdHJhaW50VGFibGUsIHZhbHVlIH0pID0+IHtcbiAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdmFsdWUgPT09ICdzdHJpbmcnICYmIHZhbHVlLmluZGV4T2YoJyUnKSA+IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLnB1c2gob3BlcmF0b3JNYXAubGlrZShjb25zdHJhaW50VGFibGVbY29sXSwgdmFsdWUpKVxuICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChvcGVyYXRvck1hcC5lcXVhbHMoY29uc3RyYWludFRhYmxlW2NvbF0sIHZhbHVlKSlcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgWydqc29uJywgJ3JpY2hUZXh0J10uaW5jbHVkZXMoZmllbGQudHlwZSkgJiZcbiAgICAgICAgICAgICAgICAgIEFycmF5LmlzQXJyYXkocGF0aFNlZ21lbnRzKSAmJlxuICAgICAgICAgICAgICAgICAgcGF0aFNlZ21lbnRzLmxlbmd0aCA+IDFcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0IHNlZ21lbnRzID0gcGF0aFNlZ21lbnRzLnNsaWNlKDEpXG4gICAgICAgICAgICAgICAgICBzZWdtZW50cy51bnNoaWZ0KHRhYmxlW2NvbHVtbk5hbWVdLm5hbWUpXG5cbiAgICAgICAgICAgICAgICAgIGlmIChmaWVsZC50eXBlID09PSAncmljaFRleHQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGpzb25RdWVyeSA9IGNyZWF0ZUpTT05RdWVyeSh7XG4gICAgICAgICAgICAgICAgICAgICAgb3BlcmF0b3IsXG4gICAgICAgICAgICAgICAgICAgICAgcGF0aFNlZ21lbnRzOiBzZWdtZW50cyxcbiAgICAgICAgICAgICAgICAgICAgICB0cmVhdEFzQXJyYXk6IFsnY2hpbGRyZW4nXSxcbiAgICAgICAgICAgICAgICAgICAgICB0cmVhdFJvb3RBc0FycmF5OiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB2YWwsXG4gICAgICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChzcWwucmF3KGpzb25RdWVyeSkpXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIGNvbnN0IGpzb25RdWVyeSA9IGNvbnZlcnRQYXRoVG9KU09OVHJhdmVyc2FsKHBhdGhTZWdtZW50cylcbiAgICAgICAgICAgICAgICAgIGNvbnN0IG9wZXJhdG9yS2V5cyA9IHtcbiAgICAgICAgICAgICAgICAgICAgY29udGFpbnM6IHsgb3BlcmF0b3I6ICdpbGlrZScsIHdpbGRjYXJkOiAnJScgfSxcbiAgICAgICAgICAgICAgICAgICAgZXF1YWxzOiB7IG9wZXJhdG9yOiAnPScsIHdpbGRjYXJkOiAnJyB9LFxuICAgICAgICAgICAgICAgICAgICBleGlzdHM6IHsgb3BlcmF0b3I6IHZhbCA9PT0gdHJ1ZSA/ICdpcyBub3QgbnVsbCcgOiAnaXMgbnVsbCcgfSxcbiAgICAgICAgICAgICAgICAgICAgbGlrZTogeyBvcGVyYXRvcjogJ2xpa2UnLCB3aWxkY2FyZDogJyUnIH0sXG4gICAgICAgICAgICAgICAgICAgIG5vdF9lcXVhbHM6IHsgb3BlcmF0b3I6ICc8PicsIHdpbGRjYXJkOiAnJyB9LFxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgbGV0IGZvcm1hdHRlZFZhbHVlID0gYCcke29wZXJhdG9yS2V5c1tvcGVyYXRvcl0ud2lsZGNhcmR9JHt2YWx9JHtvcGVyYXRvcktleXNbb3BlcmF0b3JdLndpbGRjYXJkfSdgXG5cbiAgICAgICAgICAgICAgICAgIGlmIChvcGVyYXRvciA9PT0gJ2V4aXN0cycpIHtcbiAgICAgICAgICAgICAgICAgICAgZm9ybWF0dGVkVmFsdWUgPSAnJ1xuICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICBjb25zdHJhaW50cy5wdXNoKFxuICAgICAgICAgICAgICAgICAgICBzcWwucmF3KFxuICAgICAgICAgICAgICAgICAgICAgIGAke3RhYmxlW2NvbHVtbk5hbWVdLm5hbWV9JHtqc29uUXVlcnl9ICR7b3BlcmF0b3JLZXlzW29wZXJhdG9yXS5vcGVyYXRvcn0gJHtmb3JtYXR0ZWRWYWx1ZX1gLFxuICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgKVxuXG4gICAgICAgICAgICAgICAgICBicmVha1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChnZXROb3ROdWxsQ29sdW1uQnlWYWx1ZSkge1xuICAgICAgICAgICAgICAgICAgY29uc3QgY29sdW1uTmFtZSA9IGdldE5vdE51bGxDb2x1bW5CeVZhbHVlKHZhbClcbiAgICAgICAgICAgICAgICAgIGlmIChjb2x1bW5OYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLnB1c2goaXNOb3ROdWxsKHRhYmxlW2NvbHVtbk5hbWVdKSlcbiAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBRdWVyeUVycm9yKFt7IHBhdGg6IHJlbGF0aW9uT3JQYXRoIH1dKVxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAob3BlcmF0b3IgPT09ICdsaWtlJykge1xuICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChcbiAgICAgICAgICAgICAgICAgICAgYW5kKC4uLnZhbC5zcGxpdCgnICcpLm1hcCgod29yZCkgPT4gaWxpa2UodGFibGVbY29sdW1uTmFtZV0sIGAlJHt3b3JkfSVgKSkpLFxuICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgYnJlYWtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjb25zdCBzYW5pdGl6ZWRRdWVyeVZhbHVlID0gc2FuaXRpemVRdWVyeVZhbHVlKHtcbiAgICAgICAgICAgICAgICAgIGZpZWxkLFxuICAgICAgICAgICAgICAgICAgb3BlcmF0b3IsXG4gICAgICAgICAgICAgICAgICByZWxhdGlvbk9yUGF0aCxcbiAgICAgICAgICAgICAgICAgIHZhbCxcbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgaWYgKHNhbml0aXplZFF1ZXJ5VmFsdWUgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgY29uc3QgeyBvcGVyYXRvcjogcXVlcnlPcGVyYXRvciwgdmFsdWU6IHF1ZXJ5VmFsdWUgfSA9IHNhbml0aXplZFF1ZXJ5VmFsdWVcblxuICAgICAgICAgICAgICAgIGlmIChxdWVyeU9wZXJhdG9yID09PSAnbm90X2VxdWFscycgJiYgcXVlcnlWYWx1ZSAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChcbiAgICAgICAgICAgICAgICAgICAgb3IoXG4gICAgICAgICAgICAgICAgICAgICAgaXNOdWxsKHJhd0NvbHVtbiB8fCB0YWJsZVtjb2x1bW5OYW1lXSksXG4gICAgICAgICAgICAgICAgICAgICAgLyogZXNsaW50LWRpc2FibGUgQHR5cGVzY3JpcHQtZXNsaW50L25vLWV4cGxpY2l0LWFueSAqL1xuICAgICAgICAgICAgICAgICAgICAgIG5lPGFueT4ocmF3Q29sdW1uIHx8IHRhYmxlW2NvbHVtbk5hbWVdLCBxdWVyeVZhbHVlKSxcbiAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgKGZpZWxkLnR5cGUgPT09ICdyZWxhdGlvbnNoaXAnIHx8IGZpZWxkLnR5cGUgPT09ICd1cGxvYWQnKSAmJlxuICAgICAgICAgICAgICAgICAgQXJyYXkuaXNBcnJheShxdWVyeVZhbHVlKSAmJlxuICAgICAgICAgICAgICAgICAgb3BlcmF0b3IgPT09ICdub3RfaW4nXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICBjb25zdHJhaW50cy5wdXNoKFxuICAgICAgICAgICAgICAgICAgICBzcWxgJHtub3RJbkFycmF5KHRhYmxlW2NvbHVtbk5hbWVdLCBxdWVyeVZhbHVlKX0gT1JcbiAgICAgICAgICAgICAgICAgICAgJHt0YWJsZVtjb2x1bW5OYW1lXX1cbiAgICAgICAgICAgICAgICAgICAgSVNcbiAgICAgICAgICAgICAgICAgICAgTlVMTGAsXG4gICAgICAgICAgICAgICAgICApXG5cbiAgICAgICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgY29uc3RyYWludHMucHVzaChcbiAgICAgICAgICAgICAgICAgIG9wZXJhdG9yTWFwW3F1ZXJ5T3BlcmF0b3JdKHJhd0NvbHVtbiB8fCB0YWJsZVtjb2x1bW5OYW1lXSwgcXVlcnlWYWx1ZSksXG4gICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG4gIGlmIChjb25zdHJhaW50cy5sZW5ndGggPiAwKSB7XG4gICAgaWYgKHJlc3VsdCkge1xuICAgICAgcmVzdWx0ID0gYW5kKHJlc3VsdCwgLi4uY29uc3RyYWludHMpXG4gICAgfSBlbHNlIHtcbiAgICAgIHJlc3VsdCA9IGFuZCguLi5jb25zdHJhaW50cylcbiAgICB9XG4gIH1cbiAgaWYgKGNvbnN0cmFpbnRzLmxlbmd0aCA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QixNQUFNa0IsSUFBSSxLQUFLLFFBQU8sS0FDeEQ3QixNQUFNQyxPQUFPLENBQUN3RCxlQUNkbkQsYUFBYSxVQUNiO29DQUNBZCxZQUFZa0MsSUFBSSxDQUNkWSxJQUFBQSxlQUFHLENBQUEsQ0FBQyxFQUFFdUIsSUFBQUEsc0JBQVUsRUFBQzlDLEtBQUssQ0FBQ04sV0FBVyxFQUFFZ0QsWUFBWTtvQkFDaEQsRUFBRTFDLEtBQUssQ0FBQ04sV0FBVyxDQUFDOzt3QkFFaEIsQ0FBQztvQ0FHUDtnQ0FDRjtnQ0FFQWpCLFlBQVlrQyxJQUFJLENBQ2R0Qix3QkFBVyxDQUFDb0QsY0FBYyxDQUFDMUMsYUFBYUMsS0FBSyxDQUFDTixXQUFXLEVBQUVnRDs0QkFFL0Q7d0JBQ0Y7b0JBQ0Y7Z0JBQ0Y7WUFDRjtRQUNGO0lBQ0Y7SUFDQSxJQUFJakUsWUFBWUcsTUFBTSxHQUFHLEdBQUc7UUFDMUIsSUFBSUosUUFBUTtZQUNWQSxTQUFTMkQsSUFBQUEsZUFBRyxFQUFDM0QsV0FBV0M7UUFDMUIsT0FBTztZQUNMRCxTQUFTMkQsSUFBQUEsZUFBRyxLQUFJMUQ7UUFDbEI7SUFDRjtJQUNBLElBQUlBLFlBQVlHLE1BQU0sS0FBSyxLQUFLLENBQUNKLFFBQVE7UUFDdEMsQ0FBQ0EsT0FBTyxHQUFHQztJQUNkO0lBRUEsT0FBT0Q7QUFDVCJ9
@@ -5,6 +5,7 @@ type Args = {
5
5
  adapter: PostgresAdapter;
6
6
  baseColumns?: Record<string, PgColumnBuilder>;
7
7
  baseExtraConfig?: Record<string, (cols: GenericColumns) => IndexBuilder | UniqueConstraintBuilder>;
8
+ buildTexts?: boolean;
8
9
  buildNumbers?: boolean;
9
10
  buildRelationships?: boolean;
10
11
  disableNotNull: boolean;
@@ -18,9 +19,10 @@ type Args = {
18
19
  timestamps?: boolean;
19
20
  };
20
21
  type Result = {
22
+ hasManyTextField: 'index' | boolean;
21
23
  hasManyNumberField: 'index' | boolean;
22
24
  relationsToBuild: Map<string, string>;
23
25
  };
24
- export declare const buildTable: ({ adapter, baseColumns, baseExtraConfig, buildNumbers, buildRelationships, disableNotNull, disableUnique, fields, rootRelationsToBuild, rootRelationships, rootTableIDColType, rootTableName: incomingRootTableName, tableName, timestamps, }: Args) => Result;
26
+ export declare const buildTable: ({ adapter, baseColumns, baseExtraConfig, buildTexts, buildNumbers, buildRelationships, disableNotNull, disableUnique, fields, rootRelationsToBuild, rootRelationships, rootTableIDColType, rootTableName: incomingRootTableName, tableName, timestamps, }: Args) => Result;
25
27
  export {};
26
28
  //# sourceMappingURL=build.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/schema/build.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AACjG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAgB1C,OAAO,KAAK,EAAE,cAAc,EAAgB,eAAe,EAAE,MAAM,UAAU,CAAA;AAK7E,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,eAAe,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IAC7C,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,YAAY,GAAG,uBAAuB,CAAC,CAAA;IAClG,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,cAAc,EAAE,OAAO,CAAA;IACvB,aAAa,EAAE,OAAO,CAAA;IACtB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,oBAAoB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC1C,iBAAiB,CAAC,EAA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C/B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,KAAK,MAAM,GAAG;IACZ,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAA;IACnC,kBAAkB,EAAE,OAAO,GAAG,OAAO,CAAA;IACrC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACtC,CAAA;AAED,eAAO,MAAM,UAAU,8PAgBpB,IAAI,KAAG,MA+TT,CAAA"}
@@ -12,6 +12,7 @@ const _drizzleorm = require("drizzle-orm");
12
12
  const _pgcore = require("drizzle-orm/pg-core");
13
13
  const _types = require("payload/types");
14
14
  const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
15
+ const _getConfigIDType = require("./getConfigIDType");
15
16
  const _parentIDColumnMap = require("./parentIDColumnMap");
16
17
  const _traverseFields = require("./traverseFields");
17
18
  function _interop_require_default(obj) {
@@ -19,39 +20,36 @@ function _interop_require_default(obj) {
19
20
  default: obj
20
21
  };
21
22
  }
22
- const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, buildNumbers, buildRelationships, disableNotNull, disableUnique = false, fields, rootRelationsToBuild, rootRelationships, rootTableIDColType, rootTableName: incomingRootTableName, tableName, timestamps })=>{
23
+ const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, buildTexts, buildNumbers, buildRelationships, disableNotNull, disableUnique = false, fields, rootRelationsToBuild, rootRelationships, rootTableIDColType, rootTableName: incomingRootTableName, tableName, timestamps })=>{
23
24
  const rootTableName = incomingRootTableName || tableName;
24
25
  const columns = baseColumns;
25
26
  const indexes = {};
26
27
  let hasLocalizedField = false;
27
28
  let hasLocalizedRelationshipField = false;
29
+ let hasManyTextField = false;
28
30
  let hasManyNumberField = false;
31
+ let hasLocalizedManyTextField = false;
29
32
  let hasLocalizedManyNumberField = false;
30
33
  const localesColumns = {};
31
34
  const localesIndexes = {};
32
35
  let localesTable;
36
+ let textsTable;
33
37
  let numbersTable;
34
38
  // Relationships to the base collection
35
39
  const relationships = rootRelationships || new Set();
36
40
  let relationshipsTable;
37
41
  // Drizzle relations
38
42
  const relationsToBuild = new Map();
39
- const idField = fields.find((field)=>(0, _types.fieldAffectsData)(field) && field.name === 'id');
40
- let idColType = 'integer';
41
- if (idField) {
42
- if (idField.type === 'number') {
43
- idColType = 'numeric';
44
- columns.id = (0, _pgcore.numeric)('id').primaryKey();
45
- }
46
- if (idField.type === 'text') {
47
- idColType = 'varchar';
48
- columns.id = (0, _pgcore.varchar)('id').primaryKey();
49
- }
50
- } else {
51
- columns.id = (0, _pgcore.serial)('id').primaryKey();
52
- }
53
- ({ hasLocalizedField, hasLocalizedManyNumberField, hasLocalizedRelationshipField, hasManyNumberField } = (0, _traverseFields.traverseFields)({
43
+ const idColType = (0, _getConfigIDType.getConfigIDType)(fields);
44
+ const idColTypeMap = {
45
+ integer: _pgcore.serial,
46
+ numeric: _pgcore.numeric,
47
+ varchar: _pgcore.varchar
48
+ };
49
+ columns.id = idColTypeMap[idColType]('id').primaryKey();
50
+ ({ hasLocalizedField, hasLocalizedManyTextField, hasLocalizedManyNumberField, hasLocalizedRelationshipField, hasManyTextField, hasManyNumberField } = (0, _traverseFields.traverseFields)({
54
51
  adapter,
52
+ buildTexts,
55
53
  buildNumbers,
56
54
  buildRelationships,
57
55
  columns,
@@ -120,6 +118,45 @@ const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, buildNumb
120
118
  }));
121
119
  adapter.relations[`relations_${localeTableName}`] = localesTableRelations;
122
120
  }
121
+ if (hasManyTextField && buildTexts) {
122
+ const textsTableName = `${rootTableName}_texts`;
123
+ const columns = {
124
+ id: (0, _pgcore.serial)('id').primaryKey(),
125
+ text: (0, _pgcore.varchar)('text'),
126
+ order: (0, _pgcore.integer)('order').notNull(),
127
+ parent: _parentIDColumnMap.parentIDColumnMap[idColType]('parent_id').references(()=>table.id, {
128
+ onDelete: 'cascade'
129
+ }).notNull(),
130
+ path: (0, _pgcore.varchar)('path').notNull()
131
+ };
132
+ if (hasLocalizedManyTextField) {
133
+ columns.locale = adapter.enums.enum__locales('locale');
134
+ }
135
+ textsTable = (0, _pgcore.pgTable)(textsTableName, columns, (cols)=>{
136
+ const indexes = {
137
+ orderParentIdx: (0, _pgcore.index)('order_parent_idx').on(cols.order, cols.parent)
138
+ };
139
+ if (hasManyTextField === 'index') {
140
+ indexes.text_idx = (0, _pgcore.index)('text_idx').on(cols.text);
141
+ }
142
+ if (hasLocalizedManyTextField) {
143
+ indexes.localeParent = (0, _pgcore.index)('locale_parent').on(cols.locale, cols.parent);
144
+ }
145
+ return indexes;
146
+ });
147
+ adapter.tables[textsTableName] = textsTable;
148
+ const textsTableRelations = (0, _drizzleorm.relations)(textsTable, ({ one })=>({
149
+ parent: one(table, {
150
+ fields: [
151
+ textsTable.parent
152
+ ],
153
+ references: [
154
+ table.id
155
+ ]
156
+ })
157
+ }));
158
+ adapter.relations[`relations_${textsTableName}`] = textsTableRelations;
159
+ }
123
160
  if (hasManyNumberField && buildNumbers) {
124
161
  const numbersTableName = `${rootTableName}_numbers`;
125
162
  const columns = {
@@ -232,6 +269,9 @@ const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, buildNumb
232
269
  if (hasLocalizedField) {
233
270
  result._locales = many(localesTable);
234
271
  }
272
+ if (hasManyTextField) {
273
+ result._texts = many(textsTable);
274
+ }
235
275
  if (hasManyNumberField) {
236
276
  result._numbers = many(numbersTable);
237
277
  }
@@ -244,9 +284,10 @@ const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, buildNumb
244
284
  });
245
285
  adapter.relations[`relations_${tableName}`] = tableRelations;
246
286
  return {
287
+ hasManyTextField,
247
288
  hasManyNumberField,
248
289
  relationsToBuild
249
290
  };
250
291
  };
251
292
 
252
- //# sourceMappingURL=data:application/json;base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RleCgncGFyZW50X2lkeCcpLm9uKGNvbHMucGFyZW50KSxcbiAgICAgICAgICBwYXRoSWR4OiBpbmRleCgncGF0aF9pZHgnKS5vbihjb2xzLnBhdGgpLFxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGhhc0xvY2FsaXplZFJlbGF0aW9uc2hpcEZpZWxkKSB7XG4gICAgICAgICAgcmVzdWx0LmxvY2FsZUlkeCA9IGluZGV4KCdsb2NhbGVfaWR4Jykub24oY29scy5sb2NhbGUpXG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVzdWx0XG4gICAgICB9KVxuXG4gICAgICBhZGFwdGVyLnRhYmxlc1tyZWxhdGlvbnNoaXBzVGFibGVOYW1lXSA9IHJlbGF0aW9uc2hpcHNUYWJsZVxuXG4gICAgICBjb25zdCByZWxhdGlvbnNoaXBzVGFibGVSZWxhdGlvbnMgPSByZWxhdGlvbnMocmVsYXRpb25zaGlwc1RhYmxlLCAoeyBvbmUgfSkgPT4ge1xuICAgICAgICBjb25zdCByZXN1bHQ6IFJlY29yZDxzdHJpbmcsIFJlbGF0aW9uPHN0cmluZz4+ID0ge1xuICAgICAgICAgIHBhcmVudDogb25lKHRhYmxlLCB7XG4gICAgICAgICAgICBmaWVsZHM6IFtyZWxhdGlvbnNoaXBzVGFibGUucGFyZW50XSxcbiAgICAgICAgICAgIHJlZmVyZW5jZXM6IFt0YWJsZS5pZF0sXG4gICAgICAgICAgICByZWxhdGlvbk5hbWU6ICdfcmVscycsXG4gICAgICAgICAgfSksXG4gICAgICAgIH1cblxuICAgICAgICByZWxhdGlvbnNoaXBzLmZvckVhY2goKHJlbGF0aW9uVG8pID0+IHtcbiAgICAgICAgICBjb25zdCByZWxhdGVkVGFibGVOYW1lID0gdG9TbmFrZUNhc2UocmVsYXRpb25UbylcbiAgICAgICAgICBjb25zdCBpZENvbHVtbk5hbWUgPSBgJHtyZWxhdGlvblRvfUlEYFxuICAgICAgICAgIHJlc3VsdFtpZENvbHVtbk5hbW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xjQUFjbUUsSUFBSSxJQUFJakUsb0JBQW9CO1lBQzVDaUYsT0FBT2MsS0FBSyxHQUFHTCxLQUFLMUYsb0JBQW9CO2dCQUN0Q3NGLGNBQWM7WUFDaEI7UUFDRjtRQUVBLE9BQU9MO0lBQ1Q7SUFFQWhILFFBQVErRSxTQUFTLENBQUMsQ0FBQyxVQUFVLEVBQUVqRSxVQUFVLENBQUMsQ0FBQyxHQUFHMEc7SUFFOUMsT0FBTztRQUFFcEc7UUFBa0JDO1FBQW9CVztJQUFpQjtBQUNsRSJ9
@@ -0,0 +1,3 @@
1
+ import { type Field } from 'payload/types';
2
+ export declare const getConfigIDType: (fields: Field[]) => string;
3
+ //# sourceMappingURL=getConfigIDType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getConfigIDType.d.ts","sourceRoot":"","sources":["../../src/schema/getConfigIDType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAoB,MAAM,eAAe,CAAA;AAE5D,eAAO,MAAM,eAAe,WAAY,KAAK,EAAE,KAAG,MAcjD,CAAA"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "getConfigIDType", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return getConfigIDType;
9
+ }
10
+ });
11
+ const _types = require("payload/types");
12
+ const getConfigIDType = (fields)=>{
13
+ const idField = fields.find((field)=>(0, _types.fieldAffectsData)(field) && field.name === 'id');
14
+ if (idField) {
15
+ if (idField.type === 'number') {
16
+ return 'numeric';
17
+ }
18
+ if (idField.type === 'text') {
19
+ return 'varchar';
20
+ }
21
+ }
22
+ return 'integer';
23
+ };
24
+
25
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zY2hlbWEvZ2V0Q29uZmlnSURUeXBlLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIm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, TabAsField } from 'payload/types';
3
3
  import type { GenericColumns, PostgresAdapter } from '../types';
4
4
  type Args = {
5
5
  adapter: PostgresAdapter;
6
+ buildTexts: boolean;
6
7
  buildNumbers: boolean;
7
8
  buildRelationships: boolean;
8
9
  columnPrefix?: string;
@@ -25,10 +26,12 @@ type Args = {
25
26
  };
26
27
  type Result = {
27
28
  hasLocalizedField: boolean;
29
+ hasLocalizedManyTextField: boolean;
28
30
  hasLocalizedManyNumberField: boolean;
29
31
  hasLocalizedRelationshipField: boolean;
32
+ hasManyTextField: 'index' | boolean;
30
33
  hasManyNumberField: 'index' | boolean;
31
34
  };
32
- export declare const traverseFields: ({ adapter, buildNumbers, buildRelationships, columnPrefix, columns, disableNotNull, disableUnique, fieldPrefix, fields, forceLocalized, indexes, localesColumns, localesIndexes, newTableName, parentTableName, relationsToBuild, relationships, rootRelationsToBuild, rootTableIDColType, rootTableName, }: Args) => Result;
35
+ export declare const traverseFields: ({ adapter, buildTexts, buildNumbers, buildRelationships, columnPrefix, columns, disableNotNull, disableUnique, fieldPrefix, fields, forceLocalized, indexes, localesColumns, localesIndexes, newTableName, parentTableName, relationsToBuild, relationships, rootRelationsToBuild, rootTableIDColType, rootTableName, }: Args) => Result;
33
36
  export {};
34
37
  //# sourceMappingURL=traverseFields.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../src/schema/traverseFields.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAA2B,MAAM,qBAAqB,CAAA;AACjG,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAoBtD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAS/D,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,eAAe,CAAA;IACxB,YAAY,EAAE,OAAO,CAAA;IACrB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,YAAY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