@payloadcms/db-postgres 0.5.2 → 0.6.0
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 +42 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +5 -7
- package/dist/queries/buildQuery.d.ts.map +1 -1
- package/dist/queries/buildQuery.js +3 -2
- package/dist/queries/getTableColumnFromPath.d.ts +5 -1
- package/dist/queries/getTableColumnFromPath.d.ts.map +1 -1
- package/dist/queries/getTableColumnFromPath.js +40 -13
- package/dist/queries/parseParams.d.ts.map +1 -1
- package/dist/queries/parseParams.js +6 -8
- package/dist/queries/sanitizeQueryValue.d.ts +3 -1
- package/dist/queries/sanitizeQueryValue.d.ts.map +1 -1
- package/dist/queries/sanitizeQueryValue.js +5 -3
- package/dist/schema/build.d.ts.map +1 -1
- package/dist/schema/build.js +8 -10
- package/dist/schema/parentIDColumnMap.d.ts +3 -6
- package/dist/schema/parentIDColumnMap.d.ts.map +1 -1
- package/dist/schema/parentIDColumnMap.js +2 -1
- package/dist/schema/setColumnID.d.ts +11 -0
- package/dist/schema/setColumnID.d.ts.map +1 -0
- package/dist/schema/setColumnID.js +34 -0
- package/dist/schema/traverseFields.d.ts.map +1 -1
- package/dist/schema/traverseFields.js +2 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/upsertRow/insertArrays.d.ts.map +1 -1
- package/dist/upsertRow/insertArrays.js +6 -4
- package/package.json +3 -3
- package/dist/schema/getConfigIDType.d.ts +0 -3
- package/dist/schema/getConfigIDType.d.ts.map +0 -1
- package/dist/schema/getConfigIDType.js +0 -25
@@ -21,7 +21,7 @@ const insertArrays = async ({ adapter, arrays, db, parentRows })=>{
|
|
21
21
|
rows: []
|
22
22
|
};
|
23
23
|
}
|
24
|
-
const parentID = parentRows[parentRowIndex].id
|
24
|
+
const parentID = parentRows[parentRowIndex].id;
|
25
25
|
// Add any sub arrays that need to be created
|
26
26
|
// We will call this recursively below
|
27
27
|
arrayRows.forEach((arrayRow)=>{
|
@@ -42,8 +42,10 @@ const insertArrays = async ({ adapter, arrays, db, parentRows })=>{
|
|
42
42
|
// Insert all corresponding arrays
|
43
43
|
// (one insert per array table)
|
44
44
|
for (const [tableName, row] of Object.entries(rowsByTable)){
|
45
|
+
// the nested arrays need the ID for the parentID foreign key
|
46
|
+
let insertedRows;
|
45
47
|
if (row.rows.length > 0) {
|
46
|
-
await db.insert(adapter.tables[tableName]).values(row.rows).returning();
|
48
|
+
insertedRows = await db.insert(adapter.tables[tableName]).values(row.rows).returning();
|
47
49
|
}
|
48
50
|
// Insert locale rows
|
49
51
|
if (adapter.tables[`${tableName}_locales`] && row.locales.length > 0) {
|
@@ -55,10 +57,10 @@ const insertArrays = async ({ adapter, arrays, db, parentRows })=>{
|
|
55
57
|
adapter,
|
56
58
|
arrays: row.arrays,
|
57
59
|
db,
|
58
|
-
parentRows:
|
60
|
+
parentRows: insertedRows
|
59
61
|
});
|
60
62
|
}
|
61
63
|
}
|
62
64
|
};
|
63
65
|
|
64
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91cHNlcnRSb3cvaW5zZXJ0QXJyYXlzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLXBhcmFtLXJlYXNzaWduICovXG5pbXBvcnQgdHlwZSB7IEFycmF5Um93VG9JbnNlcnQgfSBmcm9tICcuLi90cmFuc2Zvcm0vd3JpdGUvdHlwZXMnXG5pbXBvcnQgdHlwZSB7IERyaXp6bGVEQiwgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi4vdHlwZXMnXG5cbnR5cGUgQXJncyA9IHtcbiAgYWRhcHRlcjogUG9zdGdyZXNBZGFwdGVyXG4gIGFycmF5czoge1xuICAgIFt0YWJsZU5hbWU6IHN0cmluZ106IEFycmF5Um93VG9JbnNlcnRbXVxuICB9W11cbiAgZGI6IERyaXp6bGVEQlxuICBwYXJlbnRSb3dzOiBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPltdXG59XG5cbnR5cGUgUm93c0J5VGFibGUgPSB7XG4gIFt0YWJsZU5hbWU6IHN0cmluZ106IHtcbiAgICBhcnJheXM6IHtcbiAgICAgIFt0YWJsZU5hbWU6IHN0cmluZ106IEFycmF5Um93VG9JbnNlcnRbXVxuICAgIH1bXVxuICAgIGxvY2FsZXM6IFJlY29yZDxzdHJpbmcsIHVua25vd24+W11cbiAgICByb3dzOiBSZWNvcmQ8c3RyaW5nLCB1bmtub3duPltdXG4gIH1cbn1cblxuZXhwb3J0IGNvbnN0IGluc2VydEFycmF5cyA9IGFzeW5jICh7IGFkYXB0ZXIsIGFycmF5cywgZGIsIHBhcmVudFJvd3MgfTogQXJncyk6IFByb21pc2U8dm9pZD4gPT4ge1xuICAvLyBNYWludGFpbiBhIG1hcCBvZiBmbGF0dGVuZWQgcm93cyBieSB0YWJsZVxuICBjb25zdCByb3dzQnlUYWJsZTogUm93c0J5VGFibGUgPSB7fVxuXG4gIGFycmF5cy5mb3JFYWNoKChhcnJheXNCeVRhYmxlLCBwYXJlbnRSb3dJbmRleCkgPT4ge1xuICAgIE9iamVjdC5lbnRyaWVzKGFycmF5c0J5VGFibGUpLmZvckVhY2goKFt0YWJsZU5hbWUsIGFycmF5Um93c10pID0+
|
66
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91cHNlcnRSb3cvaW5zZXJ0QXJyYXlzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLXBhcmFtLXJlYXNzaWduICovXG5pbXBvcnQgdHlwZSB7IEFycmF5Um93VG9JbnNlcnQgfSBmcm9tICcuLi90cmFuc2Zvcm0vd3JpdGUvdHlwZXMnXG5pbXBvcnQgdHlwZSB7IERyaXp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FHLEdBQUc7WUFDdkJPLGVBQWUsTUFBTXZCLEdBQUd3QixNQUFNLENBQUMxQixRQUFRMkIsTUFBTSxDQUFDakIsVUFBVSxFQUFFa0IsTUFBTSxDQUFDUixJQUFJUCxJQUFJLEVBQUVnQixTQUFTO1FBQ3RGO1FBRUEscUJBQXFCO1FBQ3JCLElBQUk3QixRQUFRMkIsTUFBTSxDQUFDLENBQUMsRUFBRWpCLFVBQVUsUUFBUSxDQUFDLENBQUMsSUFBSVUsSUFBSVIsT0FBTyxDQUFDTSxNQUFNLEdBQUcsR0FBRztZQUNwRSxNQUFNaEIsR0FBR3dCLE1BQU0sQ0FBQzFCLFFBQVEyQixNQUFNLENBQUMsQ0FBQyxFQUFFakIsVUFBVSxRQUFRLENBQUMsQ0FBQyxFQUFFa0IsTUFBTSxDQUFDUixJQUFJUixPQUFPLEVBQUVpQixTQUFTO1FBQ3ZGO1FBRUEsMERBQTBEO1FBQzFELElBQUlULElBQUluQixNQUFNLENBQUNpQixNQUFNLEdBQUcsR0FBRztZQUN6QixNQUFNbkIsYUFBYTtnQkFDakJDO2dCQUNBQyxRQUFRbUIsSUFBSW5CLE1BQU07Z0JBQ2xCQztnQkFDQUMsWUFBWXNCO1lBQ2Q7UUFDRjtJQUNGO0FBQ0YifQ==
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@payloadcms/db-postgres",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.6.0",
|
4
4
|
"description": "The officially supported Postgres database adapter for Payload",
|
5
5
|
"repository": "https://github.com/payloadcms/payload",
|
6
6
|
"license": "MIT",
|
@@ -25,8 +25,8 @@
|
|
25
25
|
"devDependencies": {
|
26
26
|
"@types/pg": "8.10.2",
|
27
27
|
"@types/to-snake-case": "1.0.0",
|
28
|
-
"
|
29
|
-
"
|
28
|
+
"payload": "2.11.1",
|
29
|
+
"@payloadcms/eslint-config": "1.1.1"
|
30
30
|
},
|
31
31
|
"peerDependencies": {
|
32
32
|
"payload": "^2.0.0"
|
@@ -1 +0,0 @@
|
|
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"}
|
@@ -1,25 +0,0 @@
|
|
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zY2hlbWEvZ2V0Q29uZmlnSURUeXBlLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHR5cGUgRmllbGQsIGZpZWxkQWZmZWN0c0RhdGEgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5leHBvcnQgY29uc3QgZ2V0Q29uZmlnSURUeXBlID0gKGZpZWxkczogRmllbGRbXSk6IHN0cmluZyA9PiB7XG4gIGNvbnN0IGlkRmllbGQgPSBmaWVsZHMuZmluZCgoZmllbGQpID0+IGZpZWxkQWZmZWN0c0RhdGEoZmllbGQpICYmIGZ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