@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.
- package/dist/connect.d.ts.map +1 -1
- package/dist/connect.js +30 -40
- package/dist/create.js +6 -21
- package/dist/createGlobal.js +6 -21
- package/dist/createGlobalVersion.js +10 -25
- package/dist/createMigration.js +11 -26
- package/dist/createVersion.js +10 -25
- package/dist/deleteMany.js +8 -23
- package/dist/deleteOne.js +10 -25
- package/dist/deleteVersions.js +10 -25
- package/dist/destroy.js +2 -12
- package/dist/find/buildFindManyArgs.js +6 -14
- package/dist/find/chainMethods.js +2 -11
- package/dist/find/findMany.js +14 -29
- package/dist/find/traverseFields.js +8 -23
- package/dist/find.js +6 -21
- package/dist/findGlobal.js +6 -21
- package/dist/findGlobalVersions.js +8 -23
- package/dist/findOne.js +6 -21
- package/dist/findVersions.js +8 -23
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +76 -88
- package/dist/init.js +17 -32
- package/dist/migrate.d.ts.map +1 -1
- package/dist/migrate.js +15 -33
- package/dist/migrateDown.d.ts.map +1 -1
- package/dist/migrateDown.js +12 -25
- package/dist/migrateFresh.d.ts.map +1 -1
- package/dist/migrateFresh.js +15 -31
- package/dist/migrateRefresh.d.ts.map +1 -1
- package/dist/migrateRefresh.js +18 -29
- package/dist/migrateReset.d.ts.map +1 -1
- package/dist/migrateReset.js +13 -24
- package/dist/migrateStatus.js +9 -19
- package/dist/queries/buildAndOrConditions.js +4 -14
- package/dist/queries/buildQuery.js +10 -20
- package/dist/queries/createJSONQuery/convertPathToJSONTraversal.js +4 -14
- package/dist/queries/createJSONQuery/formatJSONPathSegment.js +2 -12
- package/dist/queries/createJSONQuery/index.js +6 -16
- package/dist/queries/getTableColumnFromPath.js +38 -49
- package/dist/queries/operatorMap.js +17 -27
- package/dist/queries/parseParams.js +32 -42
- package/dist/queries/sanitizeQueryValue.js +8 -18
- package/dist/queryDrafts.js +10 -25
- package/dist/schema/build.js +49 -64
- package/dist/schema/createIndex.js +5 -15
- package/dist/schema/idToUUID.js +2 -12
- package/dist/schema/parentIDColumnMap.js +7 -17
- package/dist/schema/setColumnID.js +10 -20
- package/dist/schema/traverseFields.js +62 -77
- package/dist/schema/validateExistingBlockIsIdentical.js +9 -19
- package/dist/transactions/beginTransaction.js +4 -14
- package/dist/transactions/commitTransaction.js +2 -12
- package/dist/transactions/rollbackTransaction.js +2 -12
- package/dist/transform/read/hasManyNumber.js +2 -12
- package/dist/transform/read/hasManyText.js +2 -12
- package/dist/transform/read/index.js +12 -20
- package/dist/transform/read/relationship.js +2 -12
- package/dist/transform/read/traverseFields.js +15 -23
- package/dist/transform/write/array.js +6 -16
- package/dist/transform/write/blocks.js +6 -21
- package/dist/transform/write/index.js +4 -14
- package/dist/transform/write/numbers.js +2 -12
- package/dist/transform/write/relationships.js +4 -14
- package/dist/transform/write/selects.js +4 -14
- package/dist/transform/write/texts.js +2 -12
- package/dist/transform/write/traverseFields.js +30 -45
- package/dist/transform/write/types.js +2 -5
- package/dist/types.js +2 -5
- package/dist/update.js +11 -26
- package/dist/updateGlobal.js +6 -21
- package/dist/updateGlobalVersion.js +10 -25
- package/dist/updateVersion.js +10 -25
- package/dist/upsertRow/deleteExistingArrayRows.js +5 -15
- package/dist/upsertRow/deleteExistingRowsByPath.js +9 -19
- package/dist/upsertRow/index.d.ts.map +1 -1
- package/dist/upsertRow/index.js +25 -36
- package/dist/upsertRow/insertArrays.js +2 -12
- package/dist/upsertRow/types.js +2 -5
- package/dist/utilities/appendPrefixToKeys.js +2 -12
- package/dist/utilities/createBlocksMap.js +2 -12
- package/dist/utilities/createMigrationTable.js +4 -14
- package/dist/utilities/createRelationshipMap.js +2 -12
- package/dist/utilities/hasLocalesTable.js +5 -15
- package/dist/utilities/isArrayOfRows.js +2 -12
- package/dist/utilities/migrationTableExists.js +4 -14
- package/dist/utilities/parseError.js +6 -14
- package/package.json +6 -6
package/dist/updateVersion.js
CHANGED
@@ -1,23 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
}
|
5
|
-
|
6
|
-
enumerable: true,
|
7
|
-
get: function() {
|
8
|
-
return updateVersion;
|
9
|
-
}
|
10
|
-
});
|
11
|
-
const _versions = require("payload/versions");
|
12
|
-
const _tosnakecase = /*#__PURE__*/ _interop_require_default(require("to-snake-case"));
|
13
|
-
const _buildQuery = /*#__PURE__*/ _interop_require_default(require("./queries/buildQuery"));
|
14
|
-
const _upsertRow = require("./upsertRow");
|
15
|
-
function _interop_require_default(obj) {
|
16
|
-
return obj && obj.__esModule ? obj : {
|
17
|
-
default: obj
|
18
|
-
};
|
19
|
-
}
|
20
|
-
async function updateVersion({ id, collection, locale, req = {}, versionData, where: whereArg }) {
|
1
|
+
import { buildVersionCollectionFields } from 'payload/versions';
|
2
|
+
import toSnakeCase from 'to-snake-case';
|
3
|
+
import buildQuery from './queries/buildQuery';
|
4
|
+
import { upsertRow } from './upsertRow';
|
5
|
+
export async function updateVersion({ id, collection, locale, req = {}, versionData, where: whereArg }) {
|
21
6
|
const db = this.sessions[req.transactionID]?.db || this.drizzle;
|
22
7
|
const collectionConfig = this.payload.collections[collection].config;
|
23
8
|
const whereToUse = whereArg || {
|
@@ -25,16 +10,16 @@ async function updateVersion({ id, collection, locale, req = {}, versionData, wh
|
|
25
10
|
equals: id
|
26
11
|
}
|
27
12
|
};
|
28
|
-
const tableName = `_${(
|
29
|
-
const fields =
|
30
|
-
const { where } = await (
|
13
|
+
const tableName = `_${toSnakeCase(collection)}_v`;
|
14
|
+
const fields = buildVersionCollectionFields(collectionConfig);
|
15
|
+
const { where } = await buildQuery({
|
31
16
|
adapter: this,
|
32
17
|
fields,
|
33
18
|
locale,
|
34
19
|
tableName,
|
35
20
|
where: whereToUse
|
36
21
|
});
|
37
|
-
const result = await
|
22
|
+
const result = await upsertRow({
|
38
23
|
id,
|
39
24
|
adapter: this,
|
40
25
|
data: versionData,
|
@@ -48,4 +33,4 @@ async function updateVersion({ id, collection, locale, req = {}, versionData, wh
|
|
48
33
|
return result;
|
49
34
|
}
|
50
35
|
|
51
|
-
//# sourceMappingURL=data:application/json;base64,
|
36
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy91cGRhdGVWZXJzaW9uLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgVHlwZVdpdGhWZXJzaW9uLCBVcGRhdGVWZXJzaW9uQXJncyB9IGZyb20gJ3BheWxvYWQvZGF0YWJhc2UnXG5pbXBvcnQgdHlwZSB7IFBheWxvYWRSZXF1ZXN0LCBTYW5pdGl6ZWRDb2xsZWN0aW9uQ29uZmlnLCBUeXBlV2l0aElEIH0gZnJvbSAncGF5bG9hZC90eXBlcydcblxuaW1wb3J0IHsgYnVpbGRWZXJzaW9uQ29sbGVjdGlvbkZpZWxkcyB9IGZyb20gJ3BheWxvYWQvdmVyc2lvbnMnXG5pbXBvcnQgdG9TbmFrZUNhc2UgZnJvbSAndG8tc25ha2UtY2FzZSdcblxuaW1wb3J0IHR5cGUgeyBQb3N0Z3Jlc0FkYXB0ZXIgfSBmcm9tICcuL3R5cGVzJ1xuXG5pbXBvcnQgYnVpbGRRdWVyeSBmcm9tICcuL3F1ZXJpZXMvYnVpbGRRdWVyeSdcbmltcG9ydCB7IHVwc2VydFJvdyB9IGZyb20gJy4vdXBzZXJ0Um93J1xuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gdXBkYXRlVmVyc2lvbjxUIGV4dGVuZHMgVHlwZVdpdGhJRD4oXG4gIHRoaXM6IFBvc3RncmVzQWRhcHRlcixcbiAge1xuICAgIGlkLFxuICAgIGNvbGxlY3Rpb24sXG4gICAgbG9jYWxlLFxuICAgIHJlcSA9IHt9IGFzIFBheWxvYWRSZXF1ZXN0LFxuICAgIHZlcnNpb25EYXRhLFxuICAgIHdoZXJlOiB3aGVyZUFyZyxcbiAgfTogVXBkYXRlVmVyc2lvbkFyZ3M8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QUFFTixLQUFLLEVBQUUsR0FBRyxNQUFNUixXQUFXO1FBQ2pDc0IsU0FBUyxJQUFJO1FBQ2JEO1FBQ0FoQjtRQUNBZTtRQUNBWixPQUFPVTtJQUNUO0lBRUEsTUFBTUssU0FBUyxNQUFNdEIsVUFBOEI7UUFDakRFO1FBQ0FtQixTQUFTLElBQUk7UUFDYkUsTUFBTWpCO1FBQ05HO1FBQ0FXO1FBQ0FJLFdBQVc7UUFDWEw7UUFDQVo7UUFDQUY7SUFDRjtJQUVBLE9BQU9pQjtBQUNUIn0=
|
@@ -1,20 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
value: true
|
4
|
-
});
|
5
|
-
Object.defineProperty(exports, "deleteExistingArrayRows", {
|
6
|
-
enumerable: true,
|
7
|
-
get: function() {
|
8
|
-
return deleteExistingArrayRows;
|
9
|
-
}
|
10
|
-
});
|
11
|
-
const _drizzleorm = require("drizzle-orm");
|
12
|
-
const deleteExistingArrayRows = async ({ adapter, db, parentID, tableName })=>{
|
1
|
+
import { and, eq } from 'drizzle-orm';
|
2
|
+
export const deleteExistingArrayRows = async ({ adapter, db, parentID, tableName })=>{
|
13
3
|
const table = adapter.tables[tableName];
|
14
4
|
const whereConstraints = [
|
15
|
-
|
5
|
+
eq(table._parentID, parentID)
|
16
6
|
];
|
17
|
-
await db.delete(table).where(
|
7
|
+
await db.delete(table).where(and(...whereConstraints));
|
18
8
|
};
|
19
9
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91cHNlcnRSb3cvZGVsZXRlRXhpc3RpbmdBcnJheVJvd3MudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgYW5kLCBlcSB9IGZyb20gJ2RyaXp6bGUtb3JtJ1xuXG5pbXBvcnQgdHlwZSB7IERyaXp6bGVEQiwgUG9zdGdyZXNBZGFwdG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TUQsR0FBR08sTUFBTSxDQUFDSixPQUFPSyxLQUFLLENBQUNaLE9BQU9TO0FBQ3RDLEVBQUMifQ==
|
@@ -1,15 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
value: true
|
4
|
-
});
|
5
|
-
Object.defineProperty(exports, "deleteExistingRowsByPath", {
|
6
|
-
enumerable: true,
|
7
|
-
get: function() {
|
8
|
-
return deleteExistingRowsByPath;
|
9
|
-
}
|
10
|
-
});
|
11
|
-
const _drizzleorm = require("drizzle-orm");
|
12
|
-
const deleteExistingRowsByPath = async ({ adapter, db, localeColumnName = '_locale', parentColumnName = '_parentID', parentID, pathColumnName = '_path', rows, tableName })=>{
|
1
|
+
import { and, eq, inArray } from 'drizzle-orm';
|
2
|
+
export const deleteExistingRowsByPath = async ({ adapter, db, localeColumnName = '_locale', parentColumnName = '_parentID', parentID, pathColumnName = '_path', rows, tableName })=>{
|
13
3
|
const localizedPathsToDelete = new Set();
|
14
4
|
const pathsToDelete = new Set();
|
15
5
|
const table = adapter.tables[tableName];
|
@@ -26,18 +16,18 @@ const deleteExistingRowsByPath = async ({ adapter, db, localeColumnName = '_loca
|
|
26
16
|
});
|
27
17
|
if (localizedPathsToDelete.size > 0) {
|
28
18
|
const whereConstraints = [
|
29
|
-
|
19
|
+
eq(table[parentColumnName], parentID)
|
30
20
|
];
|
31
|
-
if (pathColumnName) whereConstraints.push(
|
32
|
-
await db.delete(table).where(
|
21
|
+
if (pathColumnName) whereConstraints.push(inArray(table[pathColumnName], Array.from(localizedPathsToDelete)));
|
22
|
+
await db.delete(table).where(and(...whereConstraints));
|
33
23
|
}
|
34
24
|
if (pathsToDelete.size > 0) {
|
35
25
|
const whereConstraints = [
|
36
|
-
|
26
|
+
eq(table[parentColumnName], parentID)
|
37
27
|
];
|
38
|
-
if (pathColumnName) whereConstraints.push(
|
39
|
-
await db.delete(table).where(
|
28
|
+
if (pathColumnName) whereConstraints.push(inArray(table[pathColumnName], Array.from(pathsToDelete)));
|
29
|
+
await db.delete(table).where(and(...whereConstraints));
|
40
30
|
}
|
41
31
|
};
|
42
32
|
|
43
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91cHNlcnRSb3cvZGVsZXRlRXhpc3RpbmdSb3dzQnlQYXRoLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGFuZCwgZXEsIGluQXJyYXkgfSBmcm9tICdkcml6emxlLW9ybSdcblxuaW1wb3J0IHR5cGUgeyBEcml6emxlREIsIFBvc3RncmVzQWRhcHRlciB9IGZyb20gJy4uL3R5cGVzJ1xuXG50eXBlIEFyZ3MgPSB7XG4gIGFkYXB0ZXI6IFBvc3RncmVzQWRhcHRlclxuICBkYjogRHJpenpsZURCXG4gIGxvY2FsZUNvbHVtbk5hbWU/OiBzdHJpbmdcbiAgcGFyZW50Q29sdW1uTmFtZT86IHN0cmluZ1xuICBwYXJlbnRJRDogdW5rbm93blxuICBwYXRoQ29sdW1uTmFtZT86IHN0cmluZ1xuICByb3dzOiBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPltdXG4gIHRhYmxlTmFtZTogc3RyaW5nXG59XG5cbmV4cG9ydCBjb25zdCBkZWxldGVFeGlzdGluZ1Jvd3NCeVBhdGggPSBhc3luYyAoe1xuICBhZGFwdGVyLFxuICBkYixcbiAgbG9jYWxlQ29sdW1uTmFtZSA9ICdfbG9jYWxlJyxcbiAgcGFyZW50Q29sdW1uTmFtZSA9ICdfcGFyZW50SUQnLFxuICBwYXJlbnRJRCxcbiAgcGF0aENvbHVtbk5hbWUgPSAnX3BhdGgnLFxuICByb3dzLFxuICB0YWJsZU5hbWUsXG59OiBBcmdzKTogUHJvbWlzZTx2b2lkPiA9PiB7XG4gIGNvbnN0IGxvY2FsaXplZFBhdGhzVG9EZWxldGUgPSBuZXcgU2V0PHN0cmluZz4oKVxuICBjb25zdCBwYXRoc1RvRGVsZXRlID0gbmV3IFNldDx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AO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/upsertRow/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAM/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AASnC,eAAO,MAAM,SAAS,mHAYnB,IAAI,eAkUN,CAAA"}
|
package/dist/upsertRow/index.js
CHANGED
@@ -1,26 +1,15 @@
|
|
1
|
-
/* eslint-disable no-param-reassign */
|
2
|
-
|
3
|
-
|
4
|
-
}
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
});
|
11
|
-
const _drizzleorm = require("drizzle-orm");
|
12
|
-
const _errors = require("payload/errors");
|
13
|
-
const _utilities = require("payload/utilities");
|
14
|
-
const _buildFindManyArgs = require("../find/buildFindManyArgs");
|
15
|
-
const _read = require("../transform/read");
|
16
|
-
const _write = require("../transform/write");
|
17
|
-
const _deleteExistingArrayRows = require("./deleteExistingArrayRows");
|
18
|
-
const _deleteExistingRowsByPath = require("./deleteExistingRowsByPath");
|
19
|
-
const _insertArrays = require("./insertArrays");
|
20
|
-
const upsertRow = async ({ id, adapter, data, db, fields, operation, path = '', req, tableName, upsertTarget, where })=>{
|
1
|
+
/* eslint-disable no-param-reassign */ import { eq } from 'drizzle-orm';
|
2
|
+
import { ValidationError } from 'payload/errors';
|
3
|
+
import { buildFindManyArgs } from '../find/buildFindManyArgs';
|
4
|
+
import { transform } from '../transform/read';
|
5
|
+
import { transformForWrite } from '../transform/write';
|
6
|
+
import { deleteExistingArrayRows } from './deleteExistingArrayRows';
|
7
|
+
import { deleteExistingRowsByPath } from './deleteExistingRowsByPath';
|
8
|
+
import { insertArrays } from './insertArrays';
|
9
|
+
export const upsertRow = async ({ id, adapter, data, db, fields, operation, path = '', req, tableName, upsertTarget, where })=>{
|
21
10
|
// Split out the incoming data into the corresponding:
|
22
11
|
// base row, locales, relationships, blocks, and arrays
|
23
|
-
const rowToInsert =
|
12
|
+
const rowToInsert = transformForWrite({
|
24
13
|
adapter,
|
25
14
|
data,
|
26
15
|
fields,
|
@@ -114,7 +103,7 @@ const upsertRow = async ({ id, adapter, data, db, fields, operation, path = '',
|
|
114
103
|
if (localesToInsert.length > 0) {
|
115
104
|
const localeTable = adapter.tables[`${tableName}_locales`];
|
116
105
|
if (operation === 'update') {
|
117
|
-
await db.delete(localeTable).where(
|
106
|
+
await db.delete(localeTable).where(eq(localeTable._parentID, insertedRow.id));
|
118
107
|
}
|
119
108
|
await db.insert(localeTable).values(localesToInsert);
|
120
109
|
}
|
@@ -123,7 +112,7 @@ const upsertRow = async ({ id, adapter, data, db, fields, operation, path = '',
|
|
123
112
|
// //////////////////////////////////
|
124
113
|
const relationshipsTableName = `${tableName}_rels`;
|
125
114
|
if (operation === 'update') {
|
126
|
-
await
|
115
|
+
await deleteExistingRowsByPath({
|
127
116
|
adapter,
|
128
117
|
db,
|
129
118
|
localeColumnName: 'locale',
|
@@ -145,7 +134,7 @@ const upsertRow = async ({ id, adapter, data, db, fields, operation, path = '',
|
|
145
134
|
// //////////////////////////////////
|
146
135
|
const textsTableName = `${tableName}_texts`;
|
147
136
|
if (operation === 'update') {
|
148
|
-
await
|
137
|
+
await deleteExistingRowsByPath({
|
149
138
|
adapter,
|
150
139
|
db,
|
151
140
|
localeColumnName: 'locale',
|
@@ -164,7 +153,7 @@ const upsertRow = async ({ id, adapter, data, db, fields, operation, path = '',
|
|
164
153
|
// //////////////////////////////////
|
165
154
|
const numbersTableName = `${tableName}_numbers`;
|
166
155
|
if (operation === 'update') {
|
167
|
-
await
|
156
|
+
await deleteExistingRowsByPath({
|
168
157
|
adapter,
|
169
158
|
db,
|
170
159
|
localeColumnName: 'locale',
|
@@ -186,7 +175,7 @@ const upsertRow = async ({ id, adapter, data, db, fields, operation, path = '',
|
|
186
175
|
for (const blockName of rowToInsert.blocksToDelete){
|
187
176
|
const blockTableName = `${tableName}_blocks_${blockName}`;
|
188
177
|
const blockTable = adapter.tables[blockTableName];
|
189
|
-
await db.delete(blockTable).where(
|
178
|
+
await db.delete(blockTable).where(eq(blockTable._parentID, insertedRow.id));
|
190
179
|
}
|
191
180
|
}
|
192
181
|
for (const [blockName, blockRows] of Object.entries(blocksToInsert)){
|
@@ -211,7 +200,7 @@ const upsertRow = async ({ id, adapter, data, db, fields, operation, path = '',
|
|
211
200
|
if (blockLocaleRowsToInsert.length > 0) {
|
212
201
|
await db.insert(adapter.tables[`${tableName}_blocks_${blockName}_locales`]).values(blockLocaleRowsToInsert).returning();
|
213
202
|
}
|
214
|
-
await
|
203
|
+
await insertArrays({
|
215
204
|
adapter,
|
216
205
|
arrays: blockRows.map(({ arrays })=>arrays),
|
217
206
|
db,
|
@@ -223,7 +212,7 @@ const upsertRow = async ({ id, adapter, data, db, fields, operation, path = '',
|
|
223
212
|
// //////////////////////////////////
|
224
213
|
if (operation === 'update') {
|
225
214
|
for (const arrayTableName of Object.keys(rowToInsert.arrays)){
|
226
|
-
await
|
215
|
+
await deleteExistingArrayRows({
|
227
216
|
adapter,
|
228
217
|
db,
|
229
218
|
parentID: insertedRow.id,
|
@@ -231,7 +220,7 @@ const upsertRow = async ({ id, adapter, data, db, fields, operation, path = '',
|
|
231
220
|
});
|
232
221
|
}
|
233
222
|
}
|
234
|
-
await
|
223
|
+
await insertArrays({
|
235
224
|
adapter,
|
236
225
|
arrays: [
|
237
226
|
rowToInsert.arrays
|
@@ -247,7 +236,7 @@ const upsertRow = async ({ id, adapter, data, db, fields, operation, path = '',
|
|
247
236
|
for (const [selectTableName, tableRows] of Object.entries(selectsToInsert)){
|
248
237
|
const selectTable = adapter.tables[selectTableName];
|
249
238
|
if (operation === 'update') {
|
250
|
-
await db.delete(selectTable).where(
|
239
|
+
await db.delete(selectTable).where(eq(selectTable.parent, insertedRow.id));
|
251
240
|
}
|
252
241
|
await db.insert(selectTable).values(tableRows).returning();
|
253
242
|
}
|
@@ -255,28 +244,28 @@ const upsertRow = async ({ id, adapter, data, db, fields, operation, path = '',
|
|
255
244
|
// Error Handling
|
256
245
|
// //////////////////////////////////
|
257
246
|
} catch (error) {
|
258
|
-
throw error.code === '23505' ? new
|
247
|
+
throw error.code === '23505' ? new ValidationError([
|
259
248
|
{
|
260
249
|
field: adapter.fieldConstraints[tableName][error.constraint],
|
261
250
|
message: req.t('error:valueMustBeUnique')
|
262
251
|
}
|
263
|
-
], req
|
252
|
+
], req.t) : error;
|
264
253
|
}
|
265
254
|
// //////////////////////////////////
|
266
255
|
// RETRIEVE NEWLY UPDATED ROW
|
267
256
|
// //////////////////////////////////
|
268
|
-
const findManyArgs =
|
257
|
+
const findManyArgs = buildFindManyArgs({
|
269
258
|
adapter,
|
270
259
|
depth: 0,
|
271
260
|
fields,
|
272
261
|
tableName
|
273
262
|
});
|
274
|
-
findManyArgs.where =
|
263
|
+
findManyArgs.where = eq(adapter.tables[tableName].id, insertedRow.id);
|
275
264
|
const doc = await db.query[tableName].findFirst(findManyArgs);
|
276
265
|
// //////////////////////////////////
|
277
266
|
// TRANSFORM DATA
|
278
267
|
// //////////////////////////////////
|
279
|
-
const result =
|
268
|
+
const result = transform({
|
280
269
|
config: adapter.payload.config,
|
281
270
|
data: doc,
|
282
271
|
fields
|
@@ -284,4 +273,4 @@ const upsertRow = async ({ id, adapter, data, db, fields, operation, path = '',
|
|
284
273
|
return result;
|
285
274
|
};
|
286
275
|
|
287
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91cHNlcnRSb3cvaW5kZXgudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tcGFyYW0tcmVhc3NpZ24gKi9cbmltcG9ydCB0eXBlIHsgVHlwZVdpdGhJRCB9IGZyb20gJ3BheWxvYWQvdHlwZXMnXG5cbmltcG9ydCB7IGVxIH0gZnJvb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UyxDQUFDSjtJQUVoRCxxQ0FBcUM7SUFDckMsaUJBQWlCO0lBQ2pCLHFDQUFxQztJQUVyQyxNQUFNSyxTQUFTbkcsVUFBYTtRQUMxQm9HLFFBQVE3RixRQUFROEYsT0FBTyxDQUFDRCxNQUFNO1FBQzlCNUYsTUFBTXdGO1FBQ050RjtJQUNGO0lBRUEsT0FBT3lGO0FBQ1QsRUFBQyJ9
|
@@ -1,14 +1,4 @@
|
|
1
|
-
/* eslint-disable no-param-reassign */
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
3
|
-
value: true
|
4
|
-
});
|
5
|
-
Object.defineProperty(exports, "insertArrays", {
|
6
|
-
enumerable: true,
|
7
|
-
get: function() {
|
8
|
-
return insertArrays;
|
9
|
-
}
|
10
|
-
});
|
11
|
-
const insertArrays = async ({ adapter, arrays, db, parentRows })=>{
|
1
|
+
/* eslint-disable no-param-reassign */ export const insertArrays = async ({ adapter, arrays, db, parentRows })=>{
|
12
2
|
// Maintain a map of flattened rows by table
|
13
3
|
const rowsByTable = {};
|
14
4
|
arrays.forEach((arraysByTable, parentRowIndex)=>{
|
@@ -75,4 +65,4 @@ const insertArrays = async ({ adapter, arrays, db, parentRows })=>{
|
|
75
65
|
}
|
76
66
|
};
|
77
67
|
|
78
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91cHNlcnRSb3cvaW5zZXJ0QXJyYXlzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLXBhcmFtLXJlYXNzaWduICovXG5pbXBvcnQgdHlwZSB7IEFycmF5Um93VG9JbnNlcnQgfSBmcm9tICcuLi90cmFuc2Zvcm0vd3JpdGUvdHlwZXMnXG5pbXBvcnQgdHlwZSB7IERyaXp6bGVEQiwgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi4vdHlwZXMnXG5cbnR5cGUgQXJncyA9IHtcbiAg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cbiAgICAgICAgICBsb2NhbGVzOiBbXSxcbiAgICAgICAgICByb3dzOiBbXSxcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBjb25zdCBwYXJlbnRJRCA9IHBhcmVudFJvd3NbcGFyZW50Um93SW5kZXhdLmlkXG5cbiAgICAgIC8vIEFkZCBhbnkgc3ViIGFycmF5cyB0aGF0IG5lZWQgdG8gYmUgY3JlYXRlZFxuICAgICAgLy8gV2Ugd2lsbCBjYWxsIHRoaXMgcmVjdXJzaXZlbHkgYmVsb3dcbiAgICAgIGFycmF5Um93cy5mb3JFYWNoKChhcnJheVJvdywgaSkgPT4ge1xuICAgICAgICBpZiAoT2JqZWN0LmtleXMoYXJyYXlSb3cuYXJyYXlzKS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgcm93c0J5VGFibGVbdGFibGVOYW1lXS5hcnJheXMucHVzaChhcnJheVJvdy5hcnJheXMpXG4gICAgICAgIH1cblxuICAgICAgICAvLyBTZXQgdXAgcGFyZW50IElEcyBmb3IgYm90aCByb3cgYW5kIGxvY2FsZSByb3dcbiAgICAgICAgYXJyYXlSb3cucm93Ll9wYXJlbnRJRCA9IHBhcmVudElEXG4gICAgICAgIHJvd3NCeVRhYmxlW3RhYmxlTmFtZV0ucm93cy5wdXNoKGFycmF5Um93LnJvdylcblxuICAgICAgICBPYmplY3QuZW50cmllcyhhcnJheVJvdy5sb2NhbGVzKS5mb3JFYWNoKChbYXJyYXlSb3dMb2NhbGUsIGFycmF5Um93TG9jYWxlRGF0YV0pID0+
|
68
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91cHNlcnRSb3cvaW5zZXJ0QXJyYXlzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLXBhcmFtLXJlYXNzaWduICovXG5pbXBvcnQgdHlwZSB7IEFycmF5Um93VG9JbnNlcnQgfSBmcm9tICcu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QUFRLENBQUMsQ0FBQyxJQUFJVyxJQUFJVCxPQUFPLENBQUNPLE1BQU0sR0FBRyxHQUFHO1lBQ3BFLElBQUksQ0FBQ0UsSUFBSVQsT0FBTyxDQUFDLEVBQUUsQ0FBQ1UsU0FBUyxFQUFFO2dCQUM3QkQsSUFBSVQsT0FBTyxHQUFHUyxJQUFJVCxPQUFPLENBQUNvQixHQUFHLENBQUMsQ0FBQ0MsV0FBV2hCO29CQUN4QyxJQUFJLE9BQU9nQixVQUFVUCxZQUFZLEtBQUssWUFBWTt3QkFDaERPLFVBQVVYLFNBQVMsR0FBR1csVUFBVVAsWUFBWSxDQUFDQzt3QkFDN0MsT0FBT00sVUFBVVAsWUFBWTtvQkFDL0I7b0JBQ0EsT0FBT087Z0JBQ1Q7WUFDRjtZQUNBLE1BQU0vQixHQUFHMEIsTUFBTSxDQUFDNUIsUUFBUTZCLE1BQU0sQ0FBQyxDQUFDLEVBQUVuQixVQUFVLFFBQVEsQ0FBQyxDQUFDLEVBQUVvQixNQUFNLENBQUNULElBQUlULE9BQU8sRUFBRW1CLFNBQVM7UUFDdkY7UUFFQSwwREFBMEQ7UUFDMUQsSUFBSVYsSUFBSXBCLE1BQU0sQ0FBQ2tCLE1BQU0sR0FBRyxHQUFHO1lBQ3pCLE1BQU1wQixhQUFhO2dCQUNqQkM7Z0JBQ0FDLFFBQVFvQixJQUFJcEIsTUFBTTtnQkFDbEJDO2dCQUNBQyxZQUFZd0I7WUFDZDtRQUNGO0lBQ0Y7QUFDRixFQUFDIn0=
|
package/dist/upsertRow/types.js
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
3
|
-
value: true
|
4
|
-
});
|
1
|
+
export { };
|
5
2
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91cHNlcnRSb3c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.defineProperty(exports, "appendPrefixToObjectKeys", {
|
6
|
-
enumerable: true,
|
7
|
-
get: function() {
|
8
|
-
return appendPrefixToObjectKeys;
|
9
|
-
}
|
10
|
-
});
|
11
|
-
const appendPrefixToObjectKeys = (obj, prefix)=>Object.entries(obj).reduce((res, [key, val])=>{
|
1
|
+
export const appendPrefixToObjectKeys = (obj, prefix)=>Object.entries(obj).reduce((res, [key, val])=>{
|
12
2
|
res[`${prefix}_${key}`] = val;
|
13
3
|
return res;
|
14
4
|
}, {});
|
15
5
|
|
16
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvYXBwZW5kUHJlZml4VG9LZXlzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBjb25zdCBhcHBlbmRQcmVmaXhUb09iamVjdEtleXMgPSA8VD4ob2JqOiBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPiwgcHJlZml4OiBzdHJpbmcpOiBUID0+XG4gIE9iamVjdC5lbnRyaWVzKG9iaikucmVkdWNlKChyZXMsIFtrZXksIHZhbF0pID0+
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvYXBwZW5kUHJlZml4VG9LZXlzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBjb25zdCBhcHBlbmRQcmVmaXhUb09iamVjdEtleXMgPSA8VD4ob2JqOiBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPiwgcHJlZml4OiBzdHJpbmcpOiBUID0+XG4gIE9iamVjdC5lbnRyaWVzKG9iaikucmVkdWNlKChyZXMsIFtrZXksIHZhbF0pID0+IHtcbiAgICByZXNbYCR7cHJlZml4fV8ke2tleX1gXSA9IHZhbFxuICAgIHJldHVybiByZXNcbiAgfSwge30gYXMgVClcbiJdLCJuYW1lcyI6WyJhcHBlbmRQcmVmaXhUb09iamVjdEtleXMiLCJvYmoiLCJwcmVmaXgiLCJPYmplY3QiLCJlbnRyaWVzIiwicmVkdWNlIiwicmVzIiwia2V5IiwidmFsIl0sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLE1BQU1BLDJCQUEyQixDQUFJQyxLQUE4QkMsU0FDeEVDLE9BQU9DLE9BQU8sQ0FBQ0gsS0FBS0ksTUFBTSxDQUFDLENBQUNDLEtBQUssQ0FBQ0MsS0FBS0MsSUFBSTtRQUN6Q0YsR0FBRyxDQUFDLENBQUMsRUFBRUosT0FBTyxDQUFDLEVBQUVLLElBQUksQ0FBQyxDQUFDLEdBQUdDO1FBQzFCLE9BQU9GO0lBQ1QsR0FBRyxDQUFDLEdBQU8ifQ==
|
@@ -1,14 +1,4 @@
|
|
1
|
-
/* eslint-disable no-param-reassign */
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
3
|
-
value: true
|
4
|
-
});
|
5
|
-
Object.defineProperty(exports, "createBlocksMap", {
|
6
|
-
enumerable: true,
|
7
|
-
get: function() {
|
8
|
-
return createBlocksMap;
|
9
|
-
}
|
10
|
-
});
|
11
|
-
const createBlocksMap = (data)=>{
|
1
|
+
/* eslint-disable no-param-reassign */ export const createBlocksMap = (data)=>{
|
12
2
|
const blocksMap = {};
|
13
3
|
Object.entries(data).forEach(([key, rows])=>{
|
14
4
|
if (key.startsWith('_blocks_') && Array.isArray(rows)) {
|
@@ -36,4 +26,4 @@ const createBlocksMap = (data)=>{
|
|
36
26
|
return blocksMap;
|
37
27
|
};
|
38
28
|
|
39
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvY3JlYXRlQmxvY2tzTWFwLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLXBhcmFtLXJlYXNzaWduICovXG5leHBvcnQgdHlwZSBCbG9ja3NNYXAg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MsQ0FBQ1csSUFBSUMsS0FBSyxDQUFDLEdBQUcsRUFBRTtvQkFFeERELElBQUlGLFNBQVMsR0FBR0E7b0JBQ2hCVCxTQUFTLENBQUNXLElBQUlDLEtBQUssQ0FBQyxDQUFDQyxJQUFJLENBQUNGO29CQUUxQixPQUFPQSxJQUFJQyxLQUFLO2dCQUNsQjtZQUNGO1lBRUEsT0FBT2IsSUFBSSxDQUFDSyxJQUFJO1FBQ2xCO0lBQ0Y7SUFFQUgsT0FBT0MsT0FBTyxDQUFDRixXQUFXYyxNQUFNLENBQUMsQ0FBQ0MsaUJBQWlCLENBQUNDLE1BQU1DLE9BQU87UUFDL0RGLGVBQWUsQ0FBQ0MsS0FBSyxHQUFHQyxPQUFPQyxJQUFJLENBQUMsQ0FBQ0MsR0FBR0M7WUFDdEMsSUFBSSxPQUFPRCxFQUFFRSxNQUFNLEtBQUssWUFBWSxPQUFPRCxFQUFFQyxNQUFNLEtBQUssVUFBVTtnQkFDaEUsT0FBT0YsRUFBRUUsTUFBTSxHQUFHRCxFQUFFQyxNQUFNO1lBQzVCO1lBRUEsT0FBTztRQUNUO1FBRUEsT0FBT047SUFDVCxHQUFHLENBQUM7SUFFSixPQUFPZjtBQUNULEVBQUMifQ==
|
@@ -1,17 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
value: true
|
4
|
-
});
|
5
|
-
Object.defineProperty(exports, "createMigrationTable", {
|
6
|
-
enumerable: true,
|
7
|
-
get: function() {
|
8
|
-
return createMigrationTable;
|
9
|
-
}
|
10
|
-
});
|
11
|
-
const _drizzleorm = require("drizzle-orm");
|
12
|
-
const createMigrationTable = async (adapter)=>{
|
1
|
+
import { sql } from 'drizzle-orm';
|
2
|
+
export const createMigrationTable = async (adapter)=>{
|
13
3
|
const prependSchema = adapter.schemaName ? `"${adapter.schemaName}".` : '';
|
14
|
-
await adapter.drizzle.execute(
|
4
|
+
await adapter.drizzle.execute(sql.raw(`CREATE TABLE IF NOT EXISTS ${prependSchema}"payload_migrations" (
|
15
5
|
"id" serial PRIMARY KEY NOT NULL,
|
16
6
|
"name" varchar,
|
17
7
|
"batch" numeric,
|
@@ -20,4 +10,4 @@ const createMigrationTable = async (adapter)=>{
|
|
20
10
|
);`));
|
21
11
|
};
|
22
12
|
|
23
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvY3JlYXRlTWlncmF0aW9uVGFibGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgc3FsIH0gZnJvbSAnZHJpenpsZS1vcm0nXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi4vdHlwZXMnXG5cbmV4cG9ydCBjb25zdCBjcmVhdGVNaWdyYXRpb25UYWJsZSA9IGFzeW5jIChhZGFwdGVyOiBQb3N0Z3Jlc0FkYXB0ZXIpOiBQcm9taXNlPHZvaWQ+ID0+IHtcbiAgY29uc3QgcHJlcGVuZFNjaGVtYSA9IGFkYXB0ZXIuc2NoZW1hTmFtZSA/
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvY3JlYXRlTWlncmF0aW9uVGFibGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgc3FsIH0gZnJvbSAnZHJpenpsZS1vcm0nXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi4vdHlwZXMnXG5cbmV4cG9ydCBjb25zdCBjcmVhdGVNaWdyYXRpb25UYWJsZSA9IGFzeW5jIChhZGFwdGVyOiBQb3N0Z3Jlc0FkYXB0ZXIpOiBQcm9taXNlPHZvaWQ+ID0+IHtcbiAgY29uc3QgcHJlcGVuZFNjaGVtYSA9IGFkYXB0ZXIuc2NoZW1hTmFtZSA/IGBcIiR7Y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