@payloadcms/db-postgres 0.1.10 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/create.d.ts.map +1 -1
- package/dist/create.js +3 -2
- package/dist/createGlobal.d.ts.map +1 -1
- package/dist/createGlobal.js +3 -2
- package/dist/createGlobalVersion.d.ts +1 -1
- package/dist/createGlobalVersion.d.ts.map +1 -1
- package/dist/createGlobalVersion.js +3 -2
- package/dist/createVersion.d.ts.map +1 -1
- package/dist/createVersion.js +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/schema/traverseFields.d.ts.map +1 -1
- package/dist/schema/traverseFields.js +13 -5
- package/dist/transform/write/array.d.ts +2 -1
- package/dist/transform/write/array.d.ts.map +1 -1
- package/dist/transform/write/array.js +3 -2
- package/dist/transform/write/blocks.d.ts +2 -1
- package/dist/transform/write/blocks.d.ts.map +1 -1
- package/dist/transform/write/blocks.js +3 -2
- package/dist/transform/write/index.d.ts.map +1 -1
- package/dist/transform/write/index.js +3 -1
- package/dist/transform/write/traverseFields.d.ts +2 -1
- package/dist/transform/write/traverseFields.d.ts.map +1 -1
- package/dist/transform/write/traverseFields.js +15 -2
- package/dist/transform/write/types.d.ts +1 -0
- package/dist/transform/write/types.d.ts.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/update.d.ts.map +1 -1
- package/dist/update.js +3 -2
- package/dist/updateGlobal.d.ts.map +1 -1
- package/dist/updateGlobal.js +3 -2
- package/dist/updateGlobalVersion.d.ts +1 -2
- package/dist/updateGlobalVersion.d.ts.map +1 -1
- package/dist/updateGlobalVersion.js +3 -2
- package/dist/updateVersion.d.ts.map +1 -1
- package/dist/updateVersion.js +3 -2
- package/dist/upsertRow/index.d.ts +1 -1
- package/dist/upsertRow/index.d.ts.map +1 -1
- package/dist/upsertRow/index.js +183 -172
- package/dist/upsertRow/types.d.ts +2 -1
- package/dist/upsertRow/types.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/upsertRow/index.js
CHANGED
@@ -9,13 +9,15 @@ Object.defineProperty(exports, "upsertRow", {
|
|
9
9
|
}
|
10
10
|
});
|
11
11
|
const _drizzleorm = require("drizzle-orm");
|
12
|
+
const _errors = require("payload/errors");
|
13
|
+
const _utilities = require("payload/utilities");
|
12
14
|
const _buildFindManyArgs = require("../find/buildFindManyArgs");
|
13
15
|
const _read = require("../transform/read");
|
14
16
|
const _write = require("../transform/write");
|
15
17
|
const _deleteExistingArrayRows = require("./deleteExistingArrayRows");
|
16
18
|
const _deleteExistingRowsByPath = require("./deleteExistingRowsByPath");
|
17
19
|
const _insertArrays = require("./insertArrays");
|
18
|
-
const upsertRow = async ({ id, adapter, data, db, fields, operation, path = '', tableName, upsertTarget, where })=>{
|
20
|
+
const upsertRow = async ({ id, adapter, data, db, fields, operation, path = '', req, tableName, upsertTarget, where })=>{
|
19
21
|
// Split out the incoming data into the corresponding:
|
20
22
|
// base row, locales, relationships, blocks, and arrays
|
21
23
|
const rowToInsert = (0, _write.transformForWrite)({
|
@@ -27,200 +29,209 @@ const upsertRow = async ({ id, adapter, data, db, fields, operation, path = '',
|
|
27
29
|
});
|
28
30
|
// First, we insert the main row
|
29
31
|
let insertedRow;
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
32
|
+
try {
|
33
|
+
if (operation === 'update') {
|
34
|
+
const target = upsertTarget || adapter.tables[tableName].id;
|
35
|
+
if (id) {
|
36
|
+
rowToInsert.row.id = id;
|
37
|
+
[insertedRow] = await db.insert(adapter.tables[tableName]).values(rowToInsert.row).onConflictDoUpdate({
|
38
|
+
set: rowToInsert.row,
|
39
|
+
target
|
40
|
+
}).returning();
|
41
|
+
} else {
|
42
|
+
[insertedRow] = await db.insert(adapter.tables[tableName]).values(rowToInsert.row).onConflictDoUpdate({
|
43
|
+
set: rowToInsert.row,
|
44
|
+
target,
|
45
|
+
where
|
46
|
+
}).returning();
|
47
|
+
}
|
38
48
|
} else {
|
39
|
-
[insertedRow] = await db.insert(adapter.tables[tableName]).values(rowToInsert.row).
|
40
|
-
set: rowToInsert.row,
|
41
|
-
target,
|
42
|
-
where
|
43
|
-
}).returning();
|
49
|
+
[insertedRow] = await db.insert(adapter.tables[tableName]).values(rowToInsert.row).returning();
|
44
50
|
}
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
51
|
+
const localesToInsert = [];
|
52
|
+
const relationsToInsert = [];
|
53
|
+
const numbersToInsert = [];
|
54
|
+
const blocksToInsert = {};
|
55
|
+
const selectsToInsert = {};
|
56
|
+
// If there are locale rows with data, add the parent and locale to each
|
57
|
+
if (Object.keys(rowToInsert.locales).length > 0) {
|
58
|
+
Object.entries(rowToInsert.locales).forEach(([locale, localeRow])=>{
|
59
|
+
localeRow._parentID = insertedRow.id;
|
60
|
+
localeRow._locale = locale;
|
61
|
+
localesToInsert.push(localeRow);
|
62
|
+
});
|
63
|
+
}
|
64
|
+
// If there are relationships, add parent to each
|
65
|
+
if (rowToInsert.relationships.length > 0) {
|
66
|
+
rowToInsert.relationships.forEach((relation)=>{
|
67
|
+
relation.parent = insertedRow.id;
|
68
|
+
relationsToInsert.push(relation);
|
69
|
+
});
|
70
|
+
}
|
71
|
+
// If there are numbers, add parent to each
|
72
|
+
if (rowToInsert.numbers.length > 0) {
|
73
|
+
rowToInsert.numbers.forEach((numberRow)=>{
|
74
|
+
numberRow.parent = insertedRow.id;
|
75
|
+
numbersToInsert.push(numberRow);
|
76
|
+
});
|
77
|
+
}
|
78
|
+
// If there are selects, add parent to each, and then
|
79
|
+
// store by table name and rows
|
80
|
+
if (Object.keys(rowToInsert.selects).length > 0) {
|
81
|
+
Object.entries(rowToInsert.selects).forEach(([selectTableName, selectRows])=>{
|
82
|
+
selectRows.forEach((row)=>{
|
83
|
+
row.parent = insertedRow.id;
|
84
|
+
if (!selectsToInsert[selectTableName]) selectsToInsert[selectTableName] = [];
|
85
|
+
selectsToInsert[selectTableName].push(row);
|
86
|
+
});
|
87
|
+
});
|
88
|
+
}
|
89
|
+
// If there are blocks, add parent to each, and then
|
90
|
+
// store by table name and rows
|
91
|
+
Object.keys(rowToInsert.blocks).forEach((blockName)=>{
|
92
|
+
rowToInsert.blocks[blockName].forEach((blockRow)=>{
|
93
|
+
blockRow.row._parentID = insertedRow.id;
|
94
|
+
if (!blocksToInsert[blockName]) blocksToInsert[blockName] = [];
|
95
|
+
if (blockRow.row.uuid) {
|
96
|
+
delete blockRow.row.uuid;
|
97
|
+
}
|
98
|
+
blocksToInsert[blockName].push(blockRow);
|
83
99
|
});
|
84
100
|
});
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
if (blockRow.row.uuid) {
|
93
|
-
delete blockRow.row.uuid;
|
101
|
+
// //////////////////////////////////
|
102
|
+
// INSERT LOCALES
|
103
|
+
// //////////////////////////////////
|
104
|
+
if (localesToInsert.length > 0) {
|
105
|
+
const localeTable = adapter.tables[`${tableName}_locales`];
|
106
|
+
if (operation === 'update') {
|
107
|
+
await db.delete(localeTable).where((0, _drizzleorm.eq)(localeTable._parentID, insertedRow.id));
|
94
108
|
}
|
95
|
-
|
96
|
-
}
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
if (localesToInsert.length > 0) {
|
102
|
-
const localeTable = adapter.tables[`${tableName}_locales`];
|
109
|
+
await db.insert(localeTable).values(localesToInsert);
|
110
|
+
}
|
111
|
+
// //////////////////////////////////
|
112
|
+
// INSERT RELATIONSHIPS
|
113
|
+
// //////////////////////////////////
|
114
|
+
const relationshipsTableName = `${tableName}_rels`;
|
103
115
|
if (operation === 'update') {
|
104
|
-
await
|
116
|
+
await (0, _deleteExistingRowsByPath.deleteExistingRowsByPath)({
|
117
|
+
adapter,
|
118
|
+
db,
|
119
|
+
localeColumnName: 'locale',
|
120
|
+
parentColumnName: 'parent',
|
121
|
+
parentID: insertedRow.id,
|
122
|
+
pathColumnName: 'path',
|
123
|
+
rows: [
|
124
|
+
...relationsToInsert,
|
125
|
+
...rowToInsert.relationshipsToDelete
|
126
|
+
],
|
127
|
+
tableName: relationshipsTableName
|
128
|
+
});
|
105
129
|
}
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
await (0, _deleteExistingRowsByPath.deleteExistingRowsByPath)({
|
114
|
-
adapter,
|
115
|
-
db,
|
116
|
-
localeColumnName: 'locale',
|
117
|
-
parentColumnName: 'parent',
|
118
|
-
parentID: insertedRow.id,
|
119
|
-
pathColumnName: 'path',
|
120
|
-
rows: [
|
121
|
-
...relationsToInsert,
|
122
|
-
...rowToInsert.relationshipsToDelete
|
123
|
-
],
|
124
|
-
tableName: relationshipsTableName
|
125
|
-
});
|
126
|
-
}
|
127
|
-
if (relationsToInsert.length > 0) {
|
128
|
-
await db.insert(adapter.tables[relationshipsTableName]).values(relationsToInsert);
|
129
|
-
}
|
130
|
-
// //////////////////////////////////
|
131
|
-
// INSERT hasMany NUMBERS
|
132
|
-
// //////////////////////////////////
|
133
|
-
const numbersTableName = `${tableName}_numbers`;
|
134
|
-
if (operation === 'update') {
|
135
|
-
await (0, _deleteExistingRowsByPath.deleteExistingRowsByPath)({
|
136
|
-
adapter,
|
137
|
-
db,
|
138
|
-
localeColumnName: 'locale',
|
139
|
-
parentColumnName: 'parent',
|
140
|
-
parentID: insertedRow.id,
|
141
|
-
pathColumnName: 'path',
|
142
|
-
rows: numbersToInsert,
|
143
|
-
tableName: numbersTableName
|
144
|
-
});
|
145
|
-
}
|
146
|
-
if (numbersToInsert.length > 0) {
|
147
|
-
await db.insert(adapter.tables[numbersTableName]).values(numbersToInsert).returning();
|
148
|
-
}
|
149
|
-
// //////////////////////////////////
|
150
|
-
// INSERT BLOCKS
|
151
|
-
// //////////////////////////////////
|
152
|
-
const insertedBlockRows = {};
|
153
|
-
for (const [blockName, blockRows] of Object.entries(blocksToInsert)){
|
130
|
+
if (relationsToInsert.length > 0) {
|
131
|
+
await db.insert(adapter.tables[relationshipsTableName]).values(relationsToInsert);
|
132
|
+
}
|
133
|
+
// //////////////////////////////////
|
134
|
+
// INSERT hasMany NUMBERS
|
135
|
+
// //////////////////////////////////
|
136
|
+
const numbersTableName = `${tableName}_numbers`;
|
154
137
|
if (operation === 'update') {
|
155
138
|
await (0, _deleteExistingRowsByPath.deleteExistingRowsByPath)({
|
156
139
|
adapter,
|
157
140
|
db,
|
141
|
+
localeColumnName: 'locale',
|
142
|
+
parentColumnName: 'parent',
|
158
143
|
parentID: insertedRow.id,
|
159
|
-
pathColumnName: '
|
160
|
-
rows:
|
161
|
-
tableName:
|
144
|
+
pathColumnName: 'path',
|
145
|
+
rows: numbersToInsert,
|
146
|
+
tableName: numbersTableName
|
162
147
|
});
|
163
148
|
}
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
149
|
+
if (numbersToInsert.length > 0) {
|
150
|
+
await db.insert(adapter.tables[numbersTableName]).values(numbersToInsert).returning();
|
151
|
+
}
|
152
|
+
// //////////////////////////////////
|
153
|
+
// INSERT BLOCKS
|
154
|
+
// //////////////////////////////////
|
155
|
+
const insertedBlockRows = {};
|
156
|
+
if (operation === 'update') {
|
157
|
+
for (const blockName of rowToInsert.blocksToDelete){
|
158
|
+
const blockTableName = `${tableName}_blocks_${blockName}`;
|
159
|
+
const blockTable = adapter.tables[blockTableName];
|
160
|
+
await db.delete(blockTable).where((0, _drizzleorm.eq)(blockTable._parentID, insertedRow.id));
|
161
|
+
}
|
162
|
+
}
|
163
|
+
for (const [blockName, blockRows] of Object.entries(blocksToInsert)){
|
164
|
+
insertedBlockRows[blockName] = await db.insert(adapter.tables[`${tableName}_blocks_${blockName}`]).values(blockRows.map(({ row })=>row)).returning();
|
165
|
+
insertedBlockRows[blockName].forEach((row, i)=>{
|
166
|
+
blockRows[i].row = row;
|
167
|
+
});
|
168
|
+
const blockLocaleIndexMap = [];
|
169
|
+
const blockLocaleRowsToInsert = blockRows.reduce((acc, blockRow, i)=>{
|
170
|
+
if (Object.entries(blockRow.locales).length > 0) {
|
171
|
+
Object.entries(blockRow.locales).forEach(([blockLocale, blockLocaleData])=>{
|
172
|
+
if (Object.keys(blockLocaleData).length > 0) {
|
173
|
+
blockLocaleData._parentID = blockRow.row.id;
|
174
|
+
blockLocaleData._locale = blockLocale;
|
175
|
+
acc.push(blockLocaleData);
|
176
|
+
blockLocaleIndexMap.push(i);
|
177
|
+
}
|
178
|
+
});
|
179
|
+
}
|
180
|
+
return acc;
|
181
|
+
}, []);
|
182
|
+
if (blockLocaleRowsToInsert.length > 0) {
|
183
|
+
await db.insert(adapter.tables[`${tableName}_blocks_${blockName}_locales`]).values(blockLocaleRowsToInsert).returning();
|
184
|
+
}
|
185
|
+
await (0, _insertArrays.insertArrays)({
|
186
|
+
adapter,
|
187
|
+
arrays: blockRows.map(({ arrays })=>arrays),
|
188
|
+
db,
|
189
|
+
parentRows: insertedBlockRows[blockName]
|
190
|
+
});
|
191
|
+
}
|
192
|
+
// //////////////////////////////////
|
193
|
+
// INSERT ARRAYS RECURSIVELY
|
194
|
+
// //////////////////////////////////
|
195
|
+
if (operation === 'update') {
|
196
|
+
for (const arrayTableName of Object.keys(rowToInsert.arrays)){
|
197
|
+
await (0, _deleteExistingArrayRows.deleteExistingArrayRows)({
|
198
|
+
adapter,
|
199
|
+
db,
|
200
|
+
parentID: insertedRow.id,
|
201
|
+
tableName: arrayTableName
|
178
202
|
});
|
179
203
|
}
|
180
|
-
return acc;
|
181
|
-
}, []);
|
182
|
-
if (blockLocaleRowsToInsert.length > 0) {
|
183
|
-
await db.insert(adapter.tables[`${tableName}_blocks_${blockName}_locales`]).values(blockLocaleRowsToInsert).returning();
|
184
204
|
}
|
185
205
|
await (0, _insertArrays.insertArrays)({
|
186
206
|
adapter,
|
187
|
-
arrays:
|
207
|
+
arrays: [
|
208
|
+
rowToInsert.arrays
|
209
|
+
],
|
188
210
|
db,
|
189
|
-
parentRows:
|
211
|
+
parentRows: [
|
212
|
+
insertedRow
|
213
|
+
]
|
190
214
|
});
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
parentID: insertedRow.id,
|
201
|
-
tableName: arrayTableName
|
202
|
-
});
|
215
|
+
// //////////////////////////////////
|
216
|
+
// INSERT hasMany SELECTS
|
217
|
+
// //////////////////////////////////
|
218
|
+
for (const [selectTableName, tableRows] of Object.entries(selectsToInsert)){
|
219
|
+
const selectTable = adapter.tables[selectTableName];
|
220
|
+
if (operation === 'update') {
|
221
|
+
await db.delete(selectTable).where((0, _drizzleorm.eq)(selectTable.parent, insertedRow.id));
|
222
|
+
}
|
223
|
+
await db.insert(selectTable).values(tableRows).returning();
|
203
224
|
}
|
204
|
-
}
|
205
|
-
await (0, _insertArrays.insertArrays)({
|
206
|
-
adapter,
|
207
|
-
arrays: [
|
208
|
-
rowToInsert.arrays
|
209
|
-
],
|
210
|
-
db,
|
211
|
-
parentRows: [
|
212
|
-
insertedRow
|
213
|
-
]
|
214
|
-
});
|
215
225
|
// //////////////////////////////////
|
216
|
-
//
|
226
|
+
// Error Handling
|
217
227
|
// //////////////////////////////////
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
228
|
+
} catch (error) {
|
229
|
+
throw error.code === '23505' ? new _errors.ValidationError([
|
230
|
+
{
|
231
|
+
field: adapter.fieldConstraints[tableName][error.constraint],
|
232
|
+
message: req.t('error:valueMustBeUnique')
|
233
|
+
}
|
234
|
+
], req?.t ?? (0, _utilities.i18nInit)(req.payload.config.i18n).t) : error;
|
224
235
|
}
|
225
236
|
// //////////////////////////////////
|
226
237
|
// RETRIEVE NEWLY UPDATED ROW
|
@@ -244,4 +255,4 @@ const upsertRow = async ({ id, adapter, data, db, fields, operation, path = '',
|
|
244
255
|
return result;
|
245
256
|
};
|
246
257
|
|
247
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91cHNlcnRSb3cvaW5kZXgudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tcGFyYW0tcmVhc3NpZ24gKi9cbmltcG9ydCB0eXBlIHsgVHlwZVdpdGhJRCB9IGZyb20gJ3BheWxvYWQvdHlwZXMnXG5cbmltcG9ydCB7IGVxIH0gZnJvbSAnZHJpenpsZS1vcm0nXG5cbmltcG9ydCB0eXBlIHsgQmxvY2tSb3dUb0luc2VydCB9IGZyb20gJy4uL3RyYW5zZm9ybS93cml0ZS90eXBlcydcbmltcG9ydCB0eXBlIHsgQXJncyB9IGZyb20gJy4vdHlwZXMnXG5cbmltcG9ydCB7IGJ1aWxkRmluZE1hbnlBcmdzIH0gZnJvbSAnLi4vZmluZC9idWlsZEZpbmRNYW55QXJncydcbmltcG9ydCB7IHRyYW5zZm9ybSB9IGZyb20gJy4uL3RyYW5zZm9ybS9yZWFkJ1xuaW1wb3J0IHsgdHJhbnNmb3JtRm9yV3JpdGUgfSBmcm9tICcuLi90cmFuc2Zvcm0vd3JpdGUnXG5pbXBvcnQgeyBkZWxldGVFeGlzdGluZ0FycmF5Um93cyB9IGZyb20gJy4vZGVsZXRlRXhpc3RpbmdBcnJhe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RQUNkLE1BQU1BLE1BQU1DLElBQUksS0FBSyxVQUNqQixJQUFJQyx1QkFBZSxDQUNqQjtZQUNFO2dCQUNFQyxPQUFPcEYsUUFBUXFGLGdCQUFnQixDQUFDOUUsVUFBVSxDQUFDMEUsTUFBTUssVUFBVSxDQUFDO2dCQUM1REMsU0FBU2pGLElBQUlrRixDQUFDLENBQUM7WUFDakI7U0FDRCxFQUNEbEYsS0FBS2tGLEtBQUtDLElBQUFBLG1CQUFRLEVBQUNuRixJQUFJb0YsT0FBTyxDQUFDQyxNQUFNLENBQUNDLElBQUksRUFBRUosQ0FBQyxJQUUvQ1A7SUFDTjtJQUVBLHFDQUFxQztJQUNyQyw2QkFBNkI7SUFDN0IscUNBQXFDO0lBRXJDLE1BQU1ZLGVBQWVDLElBQUFBLG9DQUFpQixFQUFDO1FBQ3JDOUY7UUFDQStGLE9BQU87UUFDUDVGO1FBQ0FJO0lBQ0Y7SUFFQXNGLGFBQWFwRixLQUFLLEdBQUcwQyxJQUFBQSxjQUFFLEVBQUNuRCxRQUFRYyxNQUFNLENBQUNQLFVBQVUsQ0FBQ1IsRUFBRSxFQUFFYSxZQUFZYixFQUFFO0lBRXBFLE1BQU1pRyxNQUFNLE1BQU05RixHQUFHK0YsS0FBSyxDQUFDMUYsVUFBVSxDQUFDMkYsU0FBUyxDQUFDTDtJQUVoRCxxQ0FBcUM7SUFDckMsaUJBQWlCO0lBQ2pCLHFDQUFxQztJQUVyQyxNQUFNTSxTQUFTQyxJQUFBQSxlQUFTLEVBQUk7UUFDMUJULFFBQVEzRixRQUFRMEYsT0FBTyxDQUFDQyxNQUFNO1FBQzlCMUYsTUFBTStGO1FBQ043RjtJQUNGO0lBRUEsT0FBT2dHO0FBQ1QifQ==
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { SQL } from 'drizzle-orm';
|
2
|
-
import type { Field } from 'payload/types';
|
2
|
+
import type { Field, PayloadRequest } from 'payload/types';
|
3
3
|
import type { DrizzleDB, GenericColumn, PostgresAdapter } from '../types';
|
4
4
|
type BaseArgs = {
|
5
5
|
adapter: PostgresAdapter;
|
@@ -8,6 +8,7 @@ type BaseArgs = {
|
|
8
8
|
fields: Field[];
|
9
9
|
path?: string;
|
10
10
|
tableName: string;
|
11
|
+
req: PayloadRequest;
|
11
12
|
};
|
12
13
|
type CreateArgs = BaseArgs & {
|
13
14
|
id?: never;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/upsertRow/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/upsertRow/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAEzE,KAAK,QAAQ,GAAG;IACd,OAAO,EAAE,eAAe,CAAA;IACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,EAAE,EAAE,SAAS,CAAA;IACb,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,KAAK,UAAU,GAAG,QAAQ,GAAG;IAC3B,EAAE,CAAC,EAAE,KAAK,CAAA;IACV,SAAS,EAAE,QAAQ,CAAA;IACnB,YAAY,CAAC,EAAE,KAAK,CAAA;IACpB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED,KAAK,UAAU,GAAG,QAAQ,GAAG;IAC3B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,SAAS,EAAE,QAAQ,CAAA;IACnB,YAAY,CAAC,EAAE,aAAa,CAAA;IAC5B,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@payloadcms/db-postgres",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.12",
|
4
4
|
"description": "The officially supported Postgres database adapter for Payload",
|
5
5
|
"repository": "https://github.com/payloadcms/payload",
|
6
6
|
"license": "MIT",
|
@@ -24,8 +24,8 @@
|
|
24
24
|
"devDependencies": {
|
25
25
|
"@types/pg": "8.10.2",
|
26
26
|
"@types/to-snake-case": "1.0.0",
|
27
|
-
"
|
28
|
-
"
|
27
|
+
"@payloadcms/eslint-config": "1.0.0",
|
28
|
+
"payload": "2.0.15"
|
29
29
|
},
|
30
30
|
"peerDependencies": {
|
31
31
|
"payload": "^2.0.0"
|