@payloadcms/db-postgres 0.7.0 → 3.0.0-alpha.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. package/dist/connect.d.ts.map +1 -1
  2. package/dist/connect.js +30 -40
  3. package/dist/create.js +6 -21
  4. package/dist/createGlobal.js +6 -21
  5. package/dist/createGlobalVersion.js +10 -25
  6. package/dist/createMigration.js +11 -26
  7. package/dist/createVersion.js +10 -25
  8. package/dist/deleteMany.js +8 -23
  9. package/dist/deleteOne.js +10 -25
  10. package/dist/deleteVersions.js +10 -25
  11. package/dist/destroy.js +2 -12
  12. package/dist/find/buildFindManyArgs.js +6 -14
  13. package/dist/find/chainMethods.js +2 -11
  14. package/dist/find/findMany.js +14 -29
  15. package/dist/find/traverseFields.js +8 -23
  16. package/dist/find.js +6 -21
  17. package/dist/findGlobal.js +6 -21
  18. package/dist/findGlobalVersions.js +8 -23
  19. package/dist/findOne.js +6 -21
  20. package/dist/findVersions.js +8 -23
  21. package/dist/index.d.ts +3 -2
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +76 -88
  24. package/dist/init.js +17 -32
  25. package/dist/migrate.d.ts.map +1 -1
  26. package/dist/migrate.js +15 -33
  27. package/dist/migrateDown.d.ts.map +1 -1
  28. package/dist/migrateDown.js +12 -25
  29. package/dist/migrateFresh.d.ts.map +1 -1
  30. package/dist/migrateFresh.js +15 -31
  31. package/dist/migrateRefresh.d.ts.map +1 -1
  32. package/dist/migrateRefresh.js +18 -29
  33. package/dist/migrateReset.d.ts.map +1 -1
  34. package/dist/migrateReset.js +13 -24
  35. package/dist/migrateStatus.js +9 -19
  36. package/dist/queries/buildAndOrConditions.js +4 -14
  37. package/dist/queries/buildQuery.js +10 -20
  38. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.js +4 -14
  39. package/dist/queries/createJSONQuery/formatJSONPathSegment.js +2 -12
  40. package/dist/queries/createJSONQuery/index.js +6 -16
  41. package/dist/queries/getTableColumnFromPath.js +38 -49
  42. package/dist/queries/operatorMap.js +17 -27
  43. package/dist/queries/parseParams.js +32 -42
  44. package/dist/queries/sanitizeQueryValue.js +8 -18
  45. package/dist/queryDrafts.js +10 -25
  46. package/dist/schema/build.js +49 -64
  47. package/dist/schema/createIndex.js +5 -15
  48. package/dist/schema/idToUUID.js +2 -12
  49. package/dist/schema/parentIDColumnMap.js +7 -17
  50. package/dist/schema/setColumnID.js +10 -20
  51. package/dist/schema/traverseFields.js +62 -77
  52. package/dist/schema/validateExistingBlockIsIdentical.js +9 -19
  53. package/dist/transactions/beginTransaction.js +4 -14
  54. package/dist/transactions/commitTransaction.js +2 -12
  55. package/dist/transactions/rollbackTransaction.js +2 -12
  56. package/dist/transform/read/hasManyNumber.js +2 -12
  57. package/dist/transform/read/hasManyText.js +2 -12
  58. package/dist/transform/read/index.js +12 -20
  59. package/dist/transform/read/relationship.js +2 -12
  60. package/dist/transform/read/traverseFields.js +15 -23
  61. package/dist/transform/write/array.js +6 -16
  62. package/dist/transform/write/blocks.js +6 -21
  63. package/dist/transform/write/index.js +4 -14
  64. package/dist/transform/write/numbers.js +2 -12
  65. package/dist/transform/write/relationships.js +4 -14
  66. package/dist/transform/write/selects.js +4 -14
  67. package/dist/transform/write/texts.js +2 -12
  68. package/dist/transform/write/traverseFields.js +30 -45
  69. package/dist/transform/write/types.js +2 -5
  70. package/dist/types.js +2 -5
  71. package/dist/update.js +11 -26
  72. package/dist/updateGlobal.js +6 -21
  73. package/dist/updateGlobalVersion.js +10 -25
  74. package/dist/updateVersion.js +10 -25
  75. package/dist/upsertRow/deleteExistingArrayRows.js +5 -15
  76. package/dist/upsertRow/deleteExistingRowsByPath.js +9 -19
  77. package/dist/upsertRow/index.d.ts.map +1 -1
  78. package/dist/upsertRow/index.js +25 -36
  79. package/dist/upsertRow/insertArrays.js +2 -12
  80. package/dist/upsertRow/types.js +2 -5
  81. package/dist/utilities/appendPrefixToKeys.js +2 -12
  82. package/dist/utilities/createBlocksMap.js +2 -12
  83. package/dist/utilities/createMigrationTable.js +4 -14
  84. package/dist/utilities/createRelationshipMap.js +2 -12
  85. package/dist/utilities/hasLocalesTable.js +5 -15
  86. package/dist/utilities/isArrayOfRows.js +2 -12
  87. package/dist/utilities/migrationTableExists.js +4 -14
  88. package/dist/utilities/parseError.js +6 -14
  89. package/package.json +6 -6
@@ -1,16 +1,6 @@
1
1
  // Flatten rows to object with path keys
2
2
  // for easier retrieval
3
- "use strict";
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- Object.defineProperty(exports, "createPathMap", {
8
- enumerable: true,
9
- get: function() {
10
- return createPathMap;
11
- }
12
- });
13
- const createPathMap = (rows)=>{
3
+ export const createPathMap = (rows)=>{
14
4
  let rowsByPath = {};
15
5
  if (Array.isArray(rows)) {
16
6
  rowsByPath = rows.reduce((res, row)=>{
@@ -26,4 +16,4 @@ const createPathMap = (rows)=>{
26
16
  return rowsByPath;
27
17
  };
28
18
 
29
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvY3JlYXRlUmVsYXRpb25zaGlwTWFwLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIEZsYXR0ZW4gcm93cyB0byBvYmplY3Qgd2l0aCBwYXRoIGtleXNcbi8vIGZvciBlYXNpZXIgcmV0cmlldmFsXG5leHBvcnQgY29uc3QgY3JlYXRlUGF0aE1hcCA9IChyb3dzOiB1bmtub3duKTogUmVjb3JkPHN0cmluZywgUmVjb3JkPHN0cmluZywgdW5rbm93bj5bXT4gPT4ge1xuICBsZXQgcm93c0J5UGF0aCA9IHt9XG5cbiAgaWYgKEFycmF5LmlzQXJyYXkocm93cykpIHtcbiAgICByb3dzQnlQYXRoID0gcm93cy5yZWR1Y2UoKHJlcywgcm93KSA9PiB7XG4gICAgICBjb25zdCBmb3JtYXR0ZWRSb3cgPSB7XG4gICAgICAgIC4uLnJvdyxcbiAgICAgIH1cblxuICAgICAgZGVsZXRlIGZvcm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xHQUFHO1lBQ1I7WUFFQSxPQUFPQyxhQUFhQyxJQUFJO1lBRXhCLElBQUksQ0FBQ0gsR0FBRyxDQUFDQyxJQUFJRSxJQUFJLENBQUMsRUFBRUgsR0FBRyxDQUFDQyxJQUFJRSxJQUFJLENBQUMsR0FBRyxFQUFFO1lBQ3RDSCxHQUFHLENBQUNDLElBQUlFLElBQUksQ0FBQyxDQUFDQyxJQUFJLENBQUNIO1lBRW5CLE9BQU9EO1FBQ1QsR0FBRyxDQUFDO0lBQ047SUFFQSxPQUFPSjtBQUNULEVBQUMifQ==
@@ -1,21 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "hasLocalesTable", {
6
- enumerable: true,
7
- get: function() {
8
- return hasLocalesTable;
9
- }
10
- });
11
- const _types = require("payload/types");
12
- const hasLocalesTable = (fields)=>{
1
+ import { fieldAffectsData, fieldHasSubFields } from 'payload/types';
2
+ export const hasLocalesTable = (fields)=>{
13
3
  return fields.some((field)=>{
14
- if ((0, _types.fieldAffectsData)(field) && field.localized) return true;
15
- if ((0, _types.fieldHasSubFields)(field) && field.type !== 'array') return hasLocalesTable(field.fields);
4
+ if (fieldAffectsData(field) && field.localized) return true;
5
+ if (fieldHasSubFields(field) && field.type !== 'array') return hasLocalesTable(field.fields);
16
6
  if (field.type === 'tabs') return field.tabs.some((tab)=>hasLocalesTable(tab.fields));
17
7
  return false;
18
8
  });
19
9
  };
20
10
 
21
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvaGFzTG9jYWxlc1RhYmxlLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgRmllbGQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyBmaWVsZEFmZmVjdHNEYXRhLCBmaWVsZEhhc1N1YkZpZWxkcyB9IGZ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0YWIiXSwibWFwcGluZ3MiOiJBQUVBLFNBQVNBLGdCQUFnQixFQUFFQyxpQkFBaUIsUUFBUSxnQkFBZTtBQUVuRSxPQUFPLE1BQU1DLGtCQUFrQixDQUFDQztJQUM5QixPQUFPQSxPQUFPQyxJQUFJLENBQUMsQ0FBQ0M7UUFDbEIsSUFBSUwsaUJBQWlCSyxVQUFVQSxNQUFNQyxTQUFTLEVBQUUsT0FBTztRQUN2RCxJQUFJTCxrQkFBa0JJLFVBQVVBLE1BQU1FLElBQUksS0FBSyxTQUFTLE9BQU9MLGdCQUFnQkcsTUFBTUYsTUFBTTtRQUMzRixJQUFJRSxNQUFNRSxJQUFJLEtBQUssUUFBUSxPQUFPRixNQUFNRyxJQUFJLENBQUNKLElBQUksQ0FBQyxDQUFDSyxNQUFRUCxnQkFBZ0JPLElBQUlOLE1BQU07UUFDckYsT0FBTztJQUNUO0FBQ0YsRUFBQyJ9
@@ -1,15 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "isArrayOfRows", {
6
- enumerable: true,
7
- get: function() {
8
- return isArrayOfRows;
9
- }
10
- });
11
- function isArrayOfRows(data) {
1
+ export function isArrayOfRows(data) {
12
2
  return Array.isArray(data);
13
3
  }
14
4
 
15
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvaXNBcnJheU9mUm93cy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gaXNBcnJheU9mUm93cyhkYXRhOiB1bmtub3duKTogZGF0YSBpcyBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPltdIHtcbiAgcmV0dXJuIEFycmF5LmlzQXJyYXkoZGF0YSlcbn1cbiJdLCJuYW1lcyI6WyJpc0FycmF5T2ZSb3dzIiwiZGF0YSIsIkFycmF5IiwiaXNBcnJheSJdLCJtYXBwaW5ncyI6Ijs7OzsrQkFBZ0JBOzs7ZUFBQUE7OztBQUFULFNBQVNBLGNBQWNDLElBQWE7SUFDekMsT0FBT0MsTUFBTUMsT0FBTyxDQUFDRjtBQUN2QiJ9
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvaXNBcnJheU9mUm93cy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gaXNBcnJheU9mUm93cyhkYXRhOiB1bmtub3duKTogZGF0YSBpcyBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPltdIHtcbiAgcmV0dXJuIEFycmF5LmlzQXJyYXkoZGF0YSlcbn1cbiJdLCJuYW1lcyI6WyJpc0FycmF5T2ZSb3dzIiwiZGF0YSIsIkFycmF5IiwiaXNBcnJheSJdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxTQUFTQSxjQUFjQyxJQUFhO0lBQ3pDLE9BQU9DLE1BQU1DLE9BQU8sQ0FBQ0Y7QUFDdkIifQ==
@@ -1,19 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "migrationTableExists", {
6
- enumerable: true,
7
- get: function() {
8
- return migrationTableExists;
9
- }
10
- });
11
- const _drizzleorm = require("drizzle-orm");
12
- const migrationTableExists = async (db)=>{
13
- const queryRes = await db.execute((0, _drizzleorm.sql)`SELECT to_regclass('public.payload_migrations');`);
1
+ import { sql } from 'drizzle-orm';
2
+ export const migrationTableExists = async (db)=>{
3
+ const queryRes = await db.execute(sql`SELECT to_regclass('public.payload_migrations');`);
14
4
  // Returns table name 'payload_migrations' or null
15
5
  const exists = queryRes.rows?.[0]?.to_regclass === 'payload_migrations';
16
6
  return exists;
17
7
  };
18
8
 
19
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy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QkFBZ0I7SUFDbkQsT0FBT0Y7QUFDVCxFQUFDIn0=
@@ -1,19 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "parseError", {
6
- enumerable: true,
7
- get: function() {
8
- return parseError;
9
- }
10
- });
11
- const _pg = require("pg");
12
- const parseError = (err, msg)=>{
1
+ import { DatabaseError } from 'pg';
2
+ /**
3
+ * Format error message with hint if available
4
+ */ export const parseError = (err, msg)=>{
13
5
  let formattedMsg = `${msg}`;
14
6
  if (err instanceof Error) {
15
7
  formattedMsg += ` ${err.message}.`;
16
- if (err instanceof _pg.DatabaseError) {
8
+ if (err instanceof DatabaseError) {
17
9
  msg += `: ${err.message}`;
18
10
  if (err.hint) msg += ` ${err.hint}.`;
19
11
  }
@@ -21,4 +13,4 @@ const parseError = (err, msg)=>{
21
13
  return formattedMsg;
22
14
  };
23
15
 
24
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvcGFyc2VFcnJvci50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBEYXRhYmFzZUVycm9yIH0gZnJvbSAncGcnXG5cbi8qKlxuICogRm9ybWF0IGVycm9yIG1lc3NhZ2Ugd2l0aCBoaW50IGlmIGF2YWlsYWJsZVxuICovXG5leHBvcnQgY29uc3QgcGFyc2VFcnJvciA9IChlcnI6IHVua25vd24sIG1zZzogc3RyaW5nKTogc3RyaW5nID0+IHtcbiAgbGV0IGZvcm1hdHRlZE1zZyA9IGAke21zZ31gXG4gIGlmIChlcnIgaW5zdGFuY2VvZiBFcnJvcikge1xuICAgIGZvcm1hdHRlZE1zZyArPSBgICR7ZXJyLm1lc3NhZ2V9LmBcbiAgICBpZiAoZXJyIGluc3RhbmNlb2YgRGF0YWJhc2VFcnJvcikge1xuICAgICAgbXNnICs9IGA6ICR7ZXJyLm1lc3NhZ2V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"version": "3.0.0-alpha.19",
4
4
  "description": "The officially supported Postgres database adapter for Payload",
5
5
  "repository": "https://github.com/payloadcms/payload",
6
6
  "license": "MIT",
@@ -13,10 +13,10 @@
13
13
  "main": "./dist/index.js",
14
14
  "types": "./dist/index.d.ts",
15
15
  "dependencies": {
16
- "@libsql/client": "^0.3.1",
16
+ "@libsql/client": "^0.5.2",
17
17
  "console-table-printer": "2.11.2",
18
18
  "drizzle-kit": "0.20.14-1f2c838",
19
- "drizzle-orm": "0.29.3",
19
+ "drizzle-orm": "0.29.4",
20
20
  "pg": "8.11.3",
21
21
  "prompts": "2.4.2",
22
22
  "to-snake-case": "1.0.0",
@@ -25,11 +25,11 @@
25
25
  "devDependencies": {
26
26
  "@types/pg": "8.10.2",
27
27
  "@types/to-snake-case": "1.0.0",
28
- "payload": "2.11.2",
29
- "@payloadcms/eslint-config": "1.1.1"
28
+ "@payloadcms/eslint-config": "1.1.1",
29
+ "payload": "3.0.0-alpha.19"
30
30
  },
31
31
  "peerDependencies": {
32
- "payload": "^2.0.0"
32
+ "payload": "3.0.0-alpha.19"
33
33
  },
34
34
  "publishConfig": {
35
35
  "registry": "https://registry.npmjs.org/"