@payloadcms/db-postgres 0.8.6 → 0.8.8
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 +5 -52
- package/dist/count.d.ts.map +1 -1
- package/dist/count.js +3 -3
- package/dist/createMigration.d.ts.map +1 -1
- package/dist/createMigration.js +10 -4
- package/dist/find/buildFindManyArgs.d.ts.map +1 -1
- package/dist/find/buildFindManyArgs.js +2 -1
- package/dist/find/findMany.d.ts.map +1 -1
- package/dist/find/findMany.js +3 -3
- package/dist/find/traverseFields.d.ts +2 -1
- package/dist/find/traverseFields.d.ts.map +1 -1
- package/dist/find/traverseFields.js +9 -3
- package/dist/init.js +3 -2
- package/dist/migrate.js +3 -3
- package/dist/migrateDown.js +2 -2
- package/dist/migrateRefresh.js +2 -2
- package/dist/migrateReset.js +3 -3
- package/dist/migrateStatus.js +2 -2
- package/dist/queries/getTableColumnFromPath.d.ts.map +1 -1
- package/dist/queries/getTableColumnFromPath.js +4 -3
- package/dist/queries/parseParams.d.ts.map +1 -1
- package/dist/queries/parseParams.js +3 -1
- package/dist/queries/sanitizeQueryValue.d.ts +2 -1
- package/dist/queries/sanitizeQueryValue.d.ts.map +1 -1
- package/dist/queries/sanitizeQueryValue.js +11 -2
- package/dist/schema/build.d.ts +10 -2
- package/dist/schema/build.d.ts.map +1 -1
- package/dist/schema/build.js +23 -6
- package/dist/schema/traverseFields.d.ts +6 -1
- package/dist/schema/traverseFields.d.ts.map +1 -1
- package/dist/schema/traverseFields.js +46 -17
- package/dist/transform/read/hasManyNumber.d.ts +2 -1
- package/dist/transform/read/hasManyNumber.d.ts.map +1 -1
- package/dist/transform/read/hasManyNumber.js +14 -4
- package/dist/transform/read/hasManyText.d.ts +2 -1
- package/dist/transform/read/hasManyText.d.ts.map +1 -1
- package/dist/transform/read/hasManyText.js +14 -4
- package/dist/transform/read/relationship.d.ts +2 -1
- package/dist/transform/read/relationship.d.ts.map +1 -1
- package/dist/transform/read/relationship.js +16 -7
- package/dist/transform/read/traverseFields.d.ts +5 -1
- package/dist/transform/read/traverseFields.d.ts.map +1 -1
- package/dist/transform/read/traverseFields.js +118 -85
- package/dist/transform/write/array.d.ts +6 -1
- package/dist/transform/write/array.d.ts.map +1 -1
- package/dist/transform/write/array.js +7 -3
- package/dist/transform/write/blocks.d.ts +6 -1
- package/dist/transform/write/blocks.d.ts.map +1 -1
- package/dist/transform/write/blocks.js +5 -3
- package/dist/transform/write/traverseFields.d.ts +6 -1
- package/dist/transform/write/traverseFields.d.ts.map +1 -1
- package/dist/transform/write/traverseFields.js +40 -15
- package/dist/types.d.ts +9 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/upsertRow/insertArrays.d.ts.map +1 -1
- package/dist/upsertRow/insertArrays.js +5 -2
- package/dist/utilities/migrationTableExists.d.ts +2 -2
- package/dist/utilities/migrationTableExists.d.ts.map +1 -1
- package/dist/utilities/migrationTableExists.js +10 -6
- package/dist/utilities/pushDevSchema.d.ts +9 -0
- package/dist/utilities/pushDevSchema.d.ts.map +1 -0
- package/dist/utilities/pushDevSchema.js +59 -0
- package/dist/utilities/requireDrizzleKit.d.ts +14 -0
- package/dist/utilities/requireDrizzleKit.d.ts.map +1 -0
- package/dist/utilities/requireDrizzleKit.js +13 -0
- package/package.json +6 -6
package/dist/connect.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AA+C/C,eAAO,MAAM,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AA+C/C,eAAO,MAAM,OAAO,EAAE,OAsCrB,CAAA"}
|
package/dist/connect.js
CHANGED
@@ -10,14 +10,8 @@ Object.defineProperty(exports, "connect", {
|
|
10
10
|
});
|
11
11
|
const _drizzleorm = require("drizzle-orm");
|
12
12
|
const _nodepostgres = require("drizzle-orm/node-postgres");
|
13
|
-
const _pgcore = require("drizzle-orm/pg-core");
|
14
13
|
const _pg = require("pg");
|
15
|
-
const
|
16
|
-
function _interop_require_default(obj) {
|
17
|
-
return obj && obj.__esModule ? obj : {
|
18
|
-
default: obj
|
19
|
-
};
|
20
|
-
}
|
14
|
+
const _pushDevSchema = require("./utilities/pushDevSchema");
|
21
15
|
const connectWithReconnect = async function({ adapter, payload, reconnect = false }) {
|
22
16
|
let result;
|
23
17
|
if (!reconnect) {
|
@@ -55,6 +49,7 @@ const connectWithReconnect = async function({ adapter, payload, reconnect = fals
|
|
55
49
|
};
|
56
50
|
const connect = async function connect(payload) {
|
57
51
|
this.schema = {
|
52
|
+
pgSchema: this.pgSchema,
|
58
53
|
...this.tables,
|
59
54
|
...this.relations,
|
60
55
|
...this.enums
|
@@ -83,51 +78,9 @@ const connect = async function connect(payload) {
|
|
83
78
|
process.exit(1);
|
84
79
|
}
|
85
80
|
// Only push schema if not in production
|
86
|
-
if (process.env.NODE_ENV
|
87
|
-
|
88
|
-
// This will prompt if clarifications are needed for Drizzle to push new schema
|
89
|
-
const { apply, hasDataLoss, statementsToExecute, warnings } = await pushSchema(this.schema, this.drizzle);
|
90
|
-
if (warnings.length) {
|
91
|
-
let message = `Warnings detected during schema push: \n\n${warnings.join('\n')}\n\n`;
|
92
|
-
if (hasDataLoss) {
|
93
|
-
message += `DATA LOSS WARNING: Possible data loss detected if schema is pushed.\n\n`;
|
94
|
-
}
|
95
|
-
message += `Accept warnings and push schema to database?`;
|
96
|
-
const { confirm: acceptWarnings } = await (0, _prompts.default)({
|
97
|
-
name: 'confirm',
|
98
|
-
type: 'confirm',
|
99
|
-
initial: false,
|
100
|
-
message
|
101
|
-
}, {
|
102
|
-
onCancel: ()=>{
|
103
|
-
process.exit(0);
|
104
|
-
}
|
105
|
-
});
|
106
|
-
// Exit if user does not accept warnings.
|
107
|
-
// Q: Is this the right type of exit for this interaction?
|
108
|
-
if (!acceptWarnings) {
|
109
|
-
process.exit(0);
|
110
|
-
}
|
111
|
-
}
|
112
|
-
await apply();
|
113
|
-
// Migration table def in order to use query using drizzle
|
114
|
-
const migrationsSchema = this.pgSchema.table('payload_migrations', {
|
115
|
-
name: (0, _pgcore.varchar)('name'),
|
116
|
-
batch: (0, _pgcore.numeric)('batch'),
|
117
|
-
created_at: (0, _pgcore.timestamp)('created_at'),
|
118
|
-
updated_at: (0, _pgcore.timestamp)('updated_at')
|
119
|
-
});
|
120
|
-
const devPush = await this.drizzle.select().from(migrationsSchema).where((0, _drizzleorm.eq)(migrationsSchema.batch, '-1'));
|
121
|
-
if (!devPush.length) {
|
122
|
-
await this.drizzle.insert(migrationsSchema).values({
|
123
|
-
name: 'dev',
|
124
|
-
batch: '-1'
|
125
|
-
});
|
126
|
-
} else {
|
127
|
-
await this.drizzle.update(migrationsSchema).set({
|
128
|
-
updated_at: new Date()
|
129
|
-
}).where((0, _drizzleorm.eq)(migrationsSchema.batch, '-1'));
|
81
|
+
if (process.env.NODE_ENV !== 'production' && process.env.PAYLOAD_MIGRATING !== 'true' && this.push !== false) {
|
82
|
+
await (0, _pushDevSchema.pushDevSchema)(this);
|
130
83
|
}
|
131
84
|
};
|
132
85
|
|
133
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jb25uZWN0LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgUGF5bG9hZCB9IGZyb20gJ3BheWxvYWQnXG5pbXBvcnQgdHlwZSB7IENvbm5lY3QgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuXG5pbXBvcnQgeyBlcSwgc3FsIH0gZnJvbSAnZHJpenpsZS1vcm0nXG5pbXBvcnQgeyBkcml6emxlIH0gZnJvbSAnZHJpenpsZS1vcm0vbm9kZS1wb3N0Z3Jlcydcbmlt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QUFFLE9BQU9ILEtBQUs7UUFDWkosUUFBUU0sTUFBTSxDQUFDbUIsS0FBSyxDQUFDLENBQUMsNENBQTRDLEVBQUVyQixJQUFJc0IsT0FBTyxDQUFDLENBQUMsRUFBRXRCO1FBQ25GYyxRQUFRUyxJQUFJLENBQUM7SUFDZjtJQUVBLHdDQUF3QztJQUN4QyxJQUNFVCxRQUFRQyxHQUFHLENBQUNTLFFBQVEsS0FBSyxnQkFDekJWLFFBQVFDLEdBQUcsQ0FBQ1UsaUJBQWlCLEtBQUssVUFDbEMsSUFBSSxDQUFDQyxJQUFJLEtBQUssT0FDZDtRQUNBLE1BQU1DLElBQUFBLDRCQUFhLEVBQUMsSUFBSTtJQUMxQjtBQUNGIn0=
|
package/dist/count.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"count.d.ts","sourceRoot":"","sources":["../src/count.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAY7C,eAAO,MAAM,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"count.d.ts","sourceRoot":"","sources":["../src/count.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAY7C,eAAO,MAAM,KAAK,EAAE,KAoDnB,CAAA"}
|
package/dist/count.js
CHANGED
@@ -53,8 +53,8 @@ const count = async function count({ collection, locale, req, where: whereArg })
|
|
53
53
|
const countResult = await (0, _chainMethods.chainMethods)({
|
54
54
|
methods: selectCountMethods,
|
55
55
|
query: db.select({
|
56
|
-
count: (0, _drizzleorm.sql)`count
|
57
|
-
|
56
|
+
count: selectCountMethods.length > 0 ? (0, _drizzleorm.sql)`count
|
57
|
+
(DISTINCT ${this.tables[tableName].id})` : (0, _drizzleorm.count)()
|
58
58
|
}).from(table).where(where)
|
59
59
|
});
|
60
60
|
return {
|
@@ -62,4 +62,4 @@ const count = async function count({ collection, locale, req, where: whereArg })
|
|
62
62
|
};
|
63
63
|
};
|
64
64
|
|
65
|
-
//# sourceMappingURL=data:application/json;base64,
|
65
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jb3VudC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IENvdW50IH0gZnJvbSAncGF5bG9hZC9kYXRhYmFzZSdcbmltcG9ydCB0eXBlIHsgU2FuaXRpemVkQ29sbGVjdGlvbkNvbmZpZyB9IGZyb20gJ3BheWxvYWQvdHlwZXMnXG5cbmltcG9ydCB7IHNxbCwgY291bnQgYXMgc3FsQ291bnQgfSBmcm9tICdkcml6emxlLW9ybSdcbmltcG9ydCB0b1NuYWtlQ2FzZSBmcm9tICd0by1zbmFrZS1jYXNlJ1xuXG5pbXBvcnQgdHlwZSB7IENoYWluZWRNZXRob2RzIH0gZnJvbSAnLi9maW5kL2NoYWluTWV0aG9kcydcbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi90eXBlcydcblxuaW1wb3J0IHsgY2hhaW5NZXRob2RzIH0gZnJvbSAnLi9maW5kL2NoYWluTWV0aG9kcydcbmltcG9ydCBidWlsZFF1ZXJ5IGZyb20gJy4vcXVlcmllcy9idWlsZFF1ZXJ5J1xuXG5leHBvcnQgY29uc3QgY291bnQ6IENvdW50ID0gYXN5bmMgZnVuY3Rpb24gY291bnQoXG4gIHRoaXM6IFBvc3RncmVzQWRhcHRlcixcbiAgeyBjb2xsZWN0aW9uLCBsb2NhbGUsIHJlcSwgd2hlcmU6IHdoZXJlQXJnIH0sXG4pIHtcbiAgY29uc3QgY29sbGVjdGlvbkNvbmZpZzogU2FuaXRpemVkQ29sbGVjdGlvbkNvbmZpZyA9IHRoaXMucGF5bG9hZC5jb2xsZWN0aW9uc1tjb2xsZWN0aW9uXS5jb25maWdcblxuICBjb25zdCB0YWJsZU5hbWUgPSB0aGlzLnRhYm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PLG1CQUFtQkcsSUFBSSxDQUFDO1lBQ3RCQyxNQUFNO2dCQUFDWDtnQkFBT1M7YUFBVTtZQUN4QkcsUUFBUTtRQUNWO0lBQ0Y7SUFFQUMsT0FBT0MsT0FBTyxDQUFDWCxPQUFPSyxPQUFPLENBQUMsQ0FBQyxDQUFDTyxXQUFXTixVQUFVO1FBQ25ELElBQUlNLFdBQVc7WUFDYlIsbUJBQW1CRyxJQUFJLENBQUM7Z0JBQ3RCQyxNQUFNO29CQUFDLElBQUksQ0FBQ1YsTUFBTSxDQUFDYyxVQUFVO29CQUFFTjtpQkFBVTtnQkFDekNHLFFBQVE7WUFDVjtRQUNGO0lBQ0Y7SUFFQSxNQUFNSSxjQUFjLE1BQU1DLElBQUFBLDBCQUFZLEVBQUM7UUFDckNDLFNBQVNYO1FBQ1RZLE9BQU92QixHQUNKd0IsTUFBTSxDQUFDO1lBQ052QyxPQUNFMEIsbUJBQW1CYyxNQUFNLEdBQUcsSUFDeEJDLElBQUFBLGVBQUcsQ0FBUSxDQUFDO29CQUNOLEVBQUUsSUFBSSxDQUFDckIsTUFBTSxDQUFDVixVQUFVLENBQUNnQyxFQUFFLENBQUMsQ0FBQyxDQUFDLEdBQ3BDQyxJQUFBQSxpQkFBUTtRQUNoQixHQUNDQyxJQUFJLENBQUN6QixPQUNMZixLQUFLLENBQUNBO0lBQ1g7SUFFQSxPQUFPO1FBQUV5QyxXQUFXQyxPQUFPWCxXQUFXLENBQUMsRUFBRSxDQUFDbkMsS0FBSztJQUFFO0FBQ25EIn0=
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createMigration.d.ts","sourceRoot":"","sources":["../src/createMigration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;
|
1
|
+
{"version":3,"file":"createMigration.d.ts","sourceRoot":"","sources":["../src/createMigration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAoDvD,eAAO,MAAM,eAAe,EAAE,eAkF7B,CAAA"}
|
package/dist/createMigration.js
CHANGED
@@ -39,19 +39,20 @@ const getDefaultDrizzleSnapshot = ()=>({
|
|
39
39
|
schemas: {},
|
40
40
|
tables: {}
|
41
41
|
},
|
42
|
-
dialect: '
|
42
|
+
dialect: 'postgresql',
|
43
43
|
enums: {},
|
44
44
|
prevId: '00000000-0000-0000-0000-00000000000',
|
45
45
|
schemas: {},
|
46
|
+
sequences: {},
|
46
47
|
tables: {},
|
47
|
-
version: '
|
48
|
+
version: '7'
|
48
49
|
});
|
49
50
|
const createMigration = async function createMigration({ forceAcceptWarning, migrationName, payload }) {
|
50
51
|
const dir = payload.db.migrationDir;
|
51
52
|
if (!_fs.default.existsSync(dir)) {
|
52
53
|
_fs.default.mkdirSync(dir);
|
53
54
|
}
|
54
|
-
const { generateDrizzleJson, generateMigration } = require('drizzle-kit/
|
55
|
+
const { generateDrizzleJson, generateMigration } = require('drizzle-kit/api');
|
55
56
|
const [yyymmdd, hhmmss] = new Date().toISOString().split('T');
|
56
57
|
const formattedDate = yyymmdd.replace(/\D/g, '');
|
57
58
|
const formattedTime = hhmmss.split('.')[0].replace(/\D/g, '');
|
@@ -59,6 +60,11 @@ const createMigration = async function createMigration({ forceAcceptWarning, mig
|
|
59
60
|
const fileName = migrationName ? `${timestamp}_${migrationName.replace(/\W/g, '_')}` : `${timestamp}`;
|
60
61
|
const filePath = `${dir}/${fileName}`;
|
61
62
|
let drizzleJsonBefore = getDefaultDrizzleSnapshot();
|
63
|
+
if (this.schemaName) {
|
64
|
+
drizzleJsonBefore.schemas = {
|
65
|
+
[this.schemaName]: this.schemaName
|
66
|
+
};
|
67
|
+
}
|
62
68
|
// Get latest migration snapshot
|
63
69
|
const latestSnapshot = _fs.default.readdirSync(dir).filter((file)=>file.endsWith('.json')).sort().reverse()?.[0];
|
64
70
|
if (latestSnapshot) {
|
@@ -92,4 +98,4 @@ const createMigration = async function createMigration({ forceAcceptWarning, mig
|
|
92
98
|
});
|
93
99
|
};
|
94
100
|
|
95
|
-
//# sourceMappingURL=data:application/json;base64,
|
101
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jcmVhdGVNaWdyYXRpb24udHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tcmVzdHJpY3RlZC1zeW50YXgsIG5vLWF3YWl0LWluLWxvb3AgKi9cbmltcG9ydCB0eXBlIHsgRHJpenpsZVNuYXBzaG90SlNPTiB9IGZyb20gJ2RyaXp6bGUta2l0L2FwaSdcbmltcG9ydCB0eXBlIHsgQ3JlYXRlTWlncmF0aW9uIH0gZnJvbSAncGF5bG9hZC9kYXRhYmFzZSdcblxuaW1wb3J0IGZzIGZyb20gJ2ZzJ1xuaW1wb3J0IHByb21wdHMgZnJvbSAncHJvbXB0cydcblxuaW1wb3J0IHR5cGUgeyBQb3N0Z3Jlc0FkYXB0ZXIgfSBmcm9tICcuL3R5cGVzJ1xuXG5jb25zdCBtaWdyYXRpb25UZW1wbGF0ZSA9IChcbiAgdXBTUUw/OiBzdHJpbmcsXG4gIGRvd25TUUw/OiBzdHJpbmcsXG4pID0+IGBpbXBvcnQgeyBNaWdyYXRlVXBBcmdzLCBNaWdyYXRlRG93bkFyZ3MgfSBmcm9tICdAcGF5bG9hZGNtcy9kYi1wb3N0Z3JlcydcbmltcG9ydCB7IHNxbCB9IGZyb20gJ2RyaXp6bGUtb3JtJ1xuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gdXAoeyBwYXlsb2FkIH06IE1pZ3JhdGVVcEFyZ3MpOiBQcm9taXNlPHZvaWQ+IHtcbiR7XG4gIHVwU1FMXG4gICAgPyBgYXdhaXQgcGF5bG9hZC5kYi5kcml6emxlLmV4ZWN1dGUoc3FsXFxgXG5cbiR7dXBTUUx9XFxgKTtcbmBcbiAgICA6ICcvLyBNaWdyYXRpb24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IsRUFBRW5DLFNBQVMsR0FBRyxDQUFDO0lBQUM7QUFDbkUifQ==
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"buildFindManyArgs.d.ts","sourceRoot":"","sources":["../../src/find/buildFindManyArgs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI/C,KAAK,kBAAkB,GAAG;IACxB,OAAO,EAAE,eAAe,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAI1D,eAAO,MAAM,iBAAiB,2CAK3B,kBAAkB,KAAG,OAAO,MAAM,EAAE,OAAO,
|
1
|
+
{"version":3,"file":"buildFindManyArgs.d.ts","sourceRoot":"","sources":["../../src/find/buildFindManyArgs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAI/C,KAAK,kBAAkB,GAAG;IACxB,OAAO,EAAE,eAAe,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAI1D,eAAO,MAAM,iBAAiB,2CAK3B,kBAAkB,KAAG,OAAO,MAAM,EAAE,OAAO,CA4D7C,CAAA"}
|
@@ -63,10 +63,11 @@ const buildFindManyArgs = ({ adapter, depth, fields, tableName })=>{
|
|
63
63
|
depth,
|
64
64
|
fields,
|
65
65
|
path: '',
|
66
|
+
tablePath: '',
|
66
67
|
topLevelArgs: result,
|
67
68
|
topLevelTableName: tableName
|
68
69
|
});
|
69
70
|
return result;
|
70
71
|
};
|
71
72
|
|
72
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maW5kL2J1aWxkRmluZE1hbnlBcmdzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgREJRdWVyeUNvbmZpZyB9IGZyb20gJ2RyaXp6bGUtb3JtJ1xuaW1wb3J0IHR5cGUgeyBGaWVsZCB9IGZyb20gJ3BheWxvYWQvdHlwZXMnXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi4vdHlwZXMnXG5cbmltcG9ydCB7IHRyYXZlcnNlRmllbGRzIH0gZnJvbSAnLi90cmF2ZXJzZUZpZWxkcydcblxudHlwZSBCdWlsZEZpbmRRdWVyeUFyZ3MgPSB7XG4gIGFkYXB0ZXI6IFBvc3RncmVzQWRhcHRlclxuICBkZXB0aDogbnVtYmVyXG4gIGZpZWxkczogRmllbGRbXVxuICB0YWJsZU5hbWU6IHN0cmluZ1xufVxuXG5leHBvcnQgdHlwZSBSZXN1bHQgPSBEQlF1ZXJ5Q29uZmlnPCdtYW55JywgdHJ1ZSwgYW55LCBhbnk+
|
73
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maW5kL2J1aWxkRmluZE1hbnlBcmdzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgREJRdWVyeUNvbmZpZyB9IGZyb20gJ2Rya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QUFFUCxVQUFVLEVBQUVILFFBQVFvQixhQUFhLENBQUMsQ0FBQyxDQUFDLEVBQUU7UUFDMURoQixPQUFPQyxJQUFJLENBQUNDLFFBQVEsR0FBR0E7SUFDekI7SUFFQWUsSUFBQUEsOEJBQWMsRUFBQztRQUNiZjtRQUNBTjtRQUNBc0IsYUFBYWxCO1FBQ2JtQixrQkFBa0JwQjtRQUNsQkY7UUFDQUM7UUFDQXNCLE1BQU07UUFDTkMsV0FBVztRQUNYQyxjQUFjdEI7UUFDZHVCLG1CQUFtQnhCO0lBQ3JCO0lBRUEsT0FBT0M7QUFDVCJ9
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"findMany.d.ts","sourceRoot":"","sources":["../../src/find/findMany.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,KAAK,EAAE,KAAK,EAA8B,MAAM,eAAe,CAAA;AAItE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAS/C,KAAK,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,GAAG;IACzC,OAAO,EAAE,eAAe,CAAA;IACxB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,QAAQ,iHAYlB,IAAI;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"findMany.d.ts","sourceRoot":"","sources":["../../src/find/findMany.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,KAAK,EAAE,KAAK,EAA8B,MAAM,eAAe,CAAA;AAItE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAS/C,KAAK,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,GAAG;IACzC,OAAO,EAAE,eAAe,CAAA;IACxB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,QAAQ,iHAYlB,IAAI;;;;;;;;;;;EAmKN,CAAA"}
|
package/dist/find/findMany.js
CHANGED
@@ -132,8 +132,8 @@ const findMany = async function find({ adapter, fields, limit: limitArg, locale,
|
|
132
132
|
const countResult = await (0, _chainMethods.chainMethods)({
|
133
133
|
methods: selectCountMethods,
|
134
134
|
query: db.select({
|
135
|
-
count: (0, _drizzleorm.sql)`count
|
136
|
-
|
135
|
+
count: selectCountMethods.length > 0 ? (0, _drizzleorm.sql)`count
|
136
|
+
(DISTINCT ${adapter.tables[tableName].id})` : (0, _drizzleorm.count)()
|
137
137
|
}).from(table).where(where)
|
138
138
|
});
|
139
139
|
totalDocs = Number(countResult[0].count);
|
@@ -175,4 +175,4 @@ const findMany = async function find({ adapter, fields, limit: limitArg, locale,
|
|
175
175
|
};
|
176
176
|
};
|
177
177
|
|
178
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maW5kL2ZpbmRNYW55LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgRmluZEFyZ3MgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuaW1wb3J0IHR5cGUgeyBGaWVsZCwgUGF5bG9hZFJlcXVlc3QsIFR5cGVXaXRoSUQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyBpbkFycmF5LCBzcWwgfSBmcm9tICdkcml6emxlLW9ybSdcblxuaW1wb3J0IHR5cGUgeyBQb3N0Z3Jlc0FkYXB0ZXIgfSBmcm9tICcuLi90eXBlcydcbmltcG9ydCB0eXBlIHsgQ2hhaW5lZE1ldGhvZHMgfSBmcm9tICcuL2NoYWluTWV0aG9kcydcblxuaW1wb3J0IGJ1aWxkUXVlcnkgZnJvbSAnLi4vcXVlcmllcy9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dDQUFnQztJQUNoQyxJQUFJTixPQUFPQyxJQUFJLENBQUN2QixjQUFjZSxNQUFNLEdBQUcsR0FBRztRQUN4QzZCLFFBQVFoRSxJQUFJLENBQUMsQ0FBQ2lFLEdBQUdDLElBQU05QyxZQUFZLENBQUM2QyxFQUFFekIsRUFBRSxDQUFDLEdBQUdwQixZQUFZLENBQUM4QyxFQUFFMUIsRUFBRSxDQUFDO0lBQ2hFO0lBRUEsSUFBSTNDLGVBQWUsU0FBUyxDQUFDYSxXQUFXO1FBQ3RDQSxZQUFZc0QsUUFBUTdCLE1BQU07UUFDMUJ4QixhQUFhO1FBQ2JHLGdCQUFnQjtRQUNoQkYsY0FBYztRQUNkQyxjQUFjO0lBQ2hCO0lBRUEsTUFBTXVCLE9BQU80QixRQUFRRyxHQUFHLENBQUMsQ0FBQ0M7UUFDeEIsT0FBT0MsSUFBQUEsZUFBUyxFQUFDO1lBQ2ZDLFFBQVEvRSxRQUFRZ0YsT0FBTyxDQUFDRCxNQUFNO1lBQzlCRjtZQUNBNUU7UUFDRjtJQUNGO0lBRUEsT0FBTztRQUNMNEM7UUFDQXZCO1FBQ0FEO1FBQ0FuQjtRQUNBNEMsVUFBVXhCLGNBQWNqQixPQUFPLElBQUk7UUFDbkNBO1FBQ0FrQjtRQUNBd0IsVUFBVTFCLGNBQWNoQixPQUFPLElBQUk7UUFDbkNjO1FBQ0FDO0lBQ0Y7QUFDRiJ9
|
@@ -8,9 +8,10 @@ type TraverseFieldArgs = {
|
|
8
8
|
depth?: number;
|
9
9
|
fields: Field[];
|
10
10
|
path: string;
|
11
|
+
tablePath: string;
|
11
12
|
topLevelArgs: Record<string, unknown>;
|
12
13
|
topLevelTableName: string;
|
13
14
|
};
|
14
|
-
export declare const traverseFields: ({ _locales, adapter, currentArgs, currentTableName, depth, fields, path, topLevelArgs, topLevelTableName, }: TraverseFieldArgs) => Record<string, unknown>;
|
15
|
+
export declare const traverseFields: ({ _locales, adapter, currentArgs, currentTableName, depth, fields, path, tablePath, topLevelArgs, topLevelTableName, }: TraverseFieldArgs) => Record<string, unknown>;
|
15
16
|
export {};
|
16
17
|
//# sourceMappingURL=traverseFields.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../src/find/traverseFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAK1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG/C,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,OAAO,EAAE,eAAe,CAAA;IACxB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACpC,gBAAgB,EAAE,MAAM,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACrC,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,cAAc,
|
1
|
+
{"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../src/find/traverseFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAK1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG/C,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,OAAO,EAAE,eAAe,CAAA;IACxB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACpC,gBAAgB,EAAE,MAAM,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACrC,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,cAAc,2HAWxB,iBAAiB,4BA6JnB,CAAA"}
|
@@ -15,7 +15,7 @@ function _interop_require_default(obj) {
|
|
15
15
|
default: obj
|
16
16
|
};
|
17
17
|
}
|
18
|
-
const traverseFields = ({ _locales, adapter, currentArgs, currentTableName, depth, fields, path, topLevelArgs, topLevelTableName })=>{
|
18
|
+
const traverseFields = ({ _locales, adapter, currentArgs, currentTableName, depth, fields, path, tablePath, topLevelArgs, topLevelTableName })=>{
|
19
19
|
fields.forEach((field)=>{
|
20
20
|
if (field.type === 'collapsible' || field.type === 'row') {
|
21
21
|
traverseFields({
|
@@ -24,6 +24,7 @@ const traverseFields = ({ _locales, adapter, currentArgs, currentTableName, dept
|
|
24
24
|
currentArgs,
|
25
25
|
currentTableName,
|
26
26
|
depth,
|
27
|
+
tablePath,
|
27
28
|
fields: field.fields,
|
28
29
|
path,
|
29
30
|
topLevelArgs,
|
@@ -34,6 +35,7 @@ const traverseFields = ({ _locales, adapter, currentArgs, currentTableName, dept
|
|
34
35
|
if (field.type === 'tabs') {
|
35
36
|
field.tabs.forEach((tab)=>{
|
36
37
|
const tabPath = (0, _types.tabHasName)(tab) ? `${path}${tab.name}_` : path;
|
38
|
+
const tabTablePath = (0, _types.tabHasName)(tab) ? `${tablePath}${(0, _tosnakecase.default)(tab.name)}_` : tablePath;
|
37
39
|
traverseFields({
|
38
40
|
_locales,
|
39
41
|
adapter,
|
@@ -42,6 +44,7 @@ const traverseFields = ({ _locales, adapter, currentArgs, currentTableName, dept
|
|
42
44
|
depth,
|
43
45
|
fields: tab.fields,
|
44
46
|
path: tabPath,
|
47
|
+
tablePath: tabTablePath,
|
45
48
|
topLevelArgs,
|
46
49
|
topLevelTableName
|
47
50
|
});
|
@@ -61,7 +64,7 @@ const traverseFields = ({ _locales, adapter, currentArgs, currentTableName, dept
|
|
61
64
|
],
|
62
65
|
with: {}
|
63
66
|
};
|
64
|
-
const arrayTableName = adapter.tableNameMap.get(`${currentTableName}_${
|
67
|
+
const arrayTableName = adapter.tableNameMap.get(`${currentTableName}_${tablePath}${(0, _tosnakecase.default)(field.name)}`);
|
65
68
|
const arrayTableNameWithLocales = `${arrayTableName}${adapter.localesSuffix}`;
|
66
69
|
if (adapter.tables[arrayTableNameWithLocales]) withArray.with._locales = _locales;
|
67
70
|
currentArgs.with[`${path}${field.name}`] = withArray;
|
@@ -73,6 +76,7 @@ const traverseFields = ({ _locales, adapter, currentArgs, currentTableName, dept
|
|
73
76
|
depth,
|
74
77
|
fields: field.fields,
|
75
78
|
path: '',
|
79
|
+
tablePath: '',
|
76
80
|
topLevelArgs,
|
77
81
|
topLevelTableName
|
78
82
|
});
|
@@ -119,6 +123,7 @@ const traverseFields = ({ _locales, adapter, currentArgs, currentTableName, dept
|
|
119
123
|
currentArgs: withBlock,
|
120
124
|
currentTableName: tableName,
|
121
125
|
depth,
|
126
|
+
tablePath: '',
|
122
127
|
fields: block.fields,
|
123
128
|
path: '',
|
124
129
|
topLevelArgs,
|
@@ -133,6 +138,7 @@ const traverseFields = ({ _locales, adapter, currentArgs, currentTableName, dept
|
|
133
138
|
adapter,
|
134
139
|
currentArgs,
|
135
140
|
currentTableName,
|
141
|
+
tablePath: `${tablePath}${(0, _tosnakecase.default)(field.name)}_`,
|
136
142
|
depth,
|
137
143
|
fields: field.fields,
|
138
144
|
path: `${path}${field.name}_`,
|
@@ -150,4 +156,4 @@ const traverseFields = ({ _locales, adapter, currentArgs, currentTableName, dept
|
|
150
156
|
return topLevelArgs;
|
151
157
|
};
|
152
158
|
|
153
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maW5kL3RyYXZlcnNlR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Wxkcy5mb3JFYWNoKChmaWVsZCkgPT4ge1xuICAgIGlmIChmaWVsZC50eXBlID09PSAnY29sbGFwc2libGUnIHx8IGZpZWxkLnR5cGUgPT09ICdyb3cnKSB7XG4gICAgICB0cmF2ZXJzZUZpZWxkcyh7XG4gICAgICAgIF9sb2NhbGVzLFxuICAgICAgICBhZGFwdGVyLFxuICAgICAgICBjdXJyZW50QXJncyxcbiAgICAgICAgY3VycmVudFRhYmxlTmFtZSxcbiAgICAgICAgZGVwdGgsXG4gICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICBwYXRoLFxuICAgICAgICB0b3BMZXZlbEFyZ3MsXG4gICAgICAgIHRvcExldmVsVGFibGVOYW1lLFxuICAgICAgfSlcblxuICAgICAgcmV0dXJuXG4gICAgfVxuXG4gICAgaWYgKGZpZWxkLnR5cGUgPT09ICd0YWJzJykge1xuICAgICAgZmllbGQudGFicy5mb3JFYWNoKCh0YWIpID0+IHtcbiAgICAgICAgY29uc3QgdGFiUGF0aCA9IHRhYkhhc05hbWUodGFiKSA/IGAke3BhdGh9JHt0YWIubmFtZX1fYCA6IHBhdGhcblxuICAgICAgICB0cmF2ZXJzZUZpZWxkcyh7XG4gICAgICAgICAgX2xvY2FsZXMsXG4gICAgICAgICAgYWRhcHRlcixcbiAgICAgICAgICBjdXJyZW50QXJncyxcbiAgICAgICAgICBjdXJyZW50VGFibGVOYW1lLFxuICAgICAgICAgIGRlcHRoLFxuICAgICAgICAgIGZpZWxkczogdGFiLmZpZWxkcyxcbiAgICAgICAgICBwYXRoOiB0YWJQYXRoLFxuICAgICAgICAgIHRvcExldmVsQXJncyxcbiAgICAgICAgICB0b3BMZXZlbFRhYmxlTmFtZSxcbiAgICAgICAgfSlcbiAgICAgIH0pXG5cbiAgICAgIHJldHVyblxuICAgIH1cblxuICAgIGlmIChmaWVsZEFmZmVjdHNEYXRhKGZpZWxkKSkge1xuICAgICAgc3dpdGNoIChmaWVsZC50eXBlKSB7XG4gICAgICAgIGNhc2UgJ2FycmF5Jzoge1xuICAgICAgICAgIGNvbnN0IHdpdGhBcnJheTogUmVzdWx0ID0ge1xuICAgICAgICAgICAgY29sdW1uczoge1xuICAgICAgICAgICAgICBfcGFyZW50SUQ6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG9yZGVyQnk6ICh7IF9vcmRlciB9LCB7IGFzYyB9KSA9PiBbYXNjKF9vcmRlcildLFxuICAgICAgICAgICAgd2l0aDoge30sXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY29uc3QgYXJyYXlUYWJsZU5hbWUgPSBhZGFwdGVyLnRhYmxlTmFtZU1hcC5nZXQoXG4gICAgICAgICAgICBgJHtjdXJyZW50VGFibGVOYW1lfV8ke3BhdGh9JHt0b1NuYWtlQ2FzZShmaWVsZC5uYW1lKX1gLFxuICAgICAgICAgIClcblxuICAgICAgICAgIGNvbnN0IGFycmF5VGFibGVOYW1lV2l0aExvY2FsZXMgPSBgJHthcnJheVRhYmxlTmFtZX0ke2FkYXB0ZXIubG9jYWxlc1N1ZmZpeH1gXG5cbiAgICAgICAgICBpZiAoYWRhcHRlci50YWJsZXNbYXJyYXlUYWJsZU5hbWVXaXRoTG9jYWxlc10pIHdpdGhBcnJheS53aXRoLl9sb2NhbGVzID0gX2xvY2FsZXNcbiAgICAgICAgICBjdXJyZW50QXJncy53aXRoW2Ake3BhdGh9JHtmaWVsZC5uYW1lfWBdID0gd2l0aEFycmF5XG5cbiAgICAgICAgICB0cmF2ZXJzZUZpZWxkcyh7XG4gICAgICAgICAgICBfbG9jYWxlcyxcbiAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICBjdXJyZW50QXJnczogd2l0aEFycmF5LFxuICAgICAgICAgICAgY3VycmVudFRhYmxlTmFtZTogYXJyYXlUYWJsZU5hbWUsXG4gICAgICAgICAgICBkZXB0aCxcbiAgICAgICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICAgICAgcGF0aDogJycsXG4gICAgICAgICAgICB0b3BMZXZlbEFyZ3MsXG4gICAgICAgICAgICB0b3BMZXZlbFRhYmxlTmFtZSxcbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgfVxuXG4gICAgICAgIGNhc2UgJ3NlbGVjdCc6IHtcbiAgICAgICAgICBpZiAoZmllbGQuaGFzTWFueSkge1xuICAgICAgICAgICAgY29uc3Qgd2l0aFNlbGVjdDogUmVzdWx0ID0ge1xuICAgICAgICAgICAgICBjb2x1bW5zOiB7XG4gICAgICAgICAgICAgICAgaWQ6IGZhbHNlLFxuICAgICAgICAgICAgICAgIG9yZGVyOiBmYWxzZSxcbiAgICAgICAgICAgICAgICBwYXJlbnQ6IGZhbHNlLFxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBvcmRlckJ5OiAoeyBvcmRlciB9LCB7IGFzYyB9KSA9PiBbYXNjKG9yZGVyKV0sXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGN1cnJlbnRBcmdzLndpdGhbYCR7cGF0aH0ke2ZpZWxkLm5hbWV9YF0gPSB3aXRoU2VsZWN0XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgfVxuXG4gICAgICAgIGNhc2UgJ2Jsb2Nrcyc6XG4gICAgICAgICAgZmllbGQuYmxvY2tzLmZvckVhY2goKGJsb2NrKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBibG9ja0tleSA9IGBfYmxvY2tzXyR7YmxvY2suc2x1Z31gXG5cbiAgICAgICAgICAgIGlmICghdG9wTGV2ZWxBcmdzW2Jsb2NrS2V5XSkge1xuICAgICAgICAgICAgICBjb25zdCB3aXRoQmxvY2s6IFJlc3VsdCA9IHtcbiAgICAgICAgICAgICAgICBjb2x1bW5zOiB7XG4gICAgICAgICAgICAgICAgICBfcGFyZW50SUQ6IGZhbHNlLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgb3JkZXJCeTogKHsgX29yZGVyIH0sIHsgYXNjIH0pID0+IFthc2MoX29yZGVyKV0sXG4gICAgICAgICAgICAgICAgd2l0aDoge30sXG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBjb25zdCB0YWJsZU5hbWUgPSBhZGFwdGVyLnRhYmxlTmFtZU1hcC5nZXQoXG4gICAgICAgICAgICAgICAgYCR7dG9wTGV2ZWxUYWJsZU5hbWV9X2Jsb2Nrc18ke3RvU25ha2VDYXNlKGJsb2NrLnNsdWcpfWAsXG4gICAgICAgICAgICAgIClcblxuICAgICAgICAgICAgICBpZiAoYWRhcHRlci50YWJsZXNbYCR7dGFibGVOYW1lfSR7YWRhcHRlci5sb2NhbGVzU3VmZml4fWBdKSB7XG4gICAgICAgICAgICAgICAgd2l0aEJsb2NrLndpdGguX2xvY2FsZXMgPSBfbG9jYWxlc1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHRvcExldmVsQXJncy53aXRoW2Jsb2NrS2V5XSA9IHdpdGhCbG9ja1xuXG4gICAgICAgICAgICAgIHRyYXZlcnNlRmllbGRzKHtcbiAgICAgICAgICAgICAgICBfbG9jYWxlcyxcbiAgICAgICAgICAgICAgICBhZGFwdGVyLFxuICAgICAgICAgICAgICAgIGN1cnJlbnRBcmdzOiB3aXRoQmxvY2ssXG4gICAgICAgICAgICAgICAgY3VycmVudFRhYmxlTmFtZTogdGFibGVOYW1lLFxuICAgICAgICAgICAgICAgIGRlcHRoLFxuICAgICAgICAgICAgICAgIGZpZWxkczogYmxvY2suZmllbGRzLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcnLFxuICAgICAgICAgICAgICAgIHRvcExldmVsQXJncyxcbiAgICAgICAgICAgICAgICB0b3BMZXZlbFRhYmxlTmFtZSxcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgYnJlYWtcblxuICAgICAgICBjYXNlICdncm91cCc6XG4gICAgICA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FxuICAgICAgICAgIHRvcExldmVsVGFibGVOYW1lLFxuICAgICAgICB9KVxuICAgICAgfSlcblxuICAgICAgcmV0dXJuXG4gICAgfVxuXG4gICAgaWYgKGZpZWxkQWZmZWN0c0RhdGEoZmllbGQpKSB7XG4gICAgICBzd2l0Y2ggKGZpZWxkLnR5cGUpIHtcbiAgICAgICAgY2FzZSAnYXJyYXknOiB7XG4gICAgICAgICAgY29uc3Qgd2l0aEFycmF5OiBSZXN1bHQgPSB7XG4gICAgICAgICAgICBjb2x1bW5zOiB7XG4gICAgICAgICAgICAgIF9wYXJlbnRJRDogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgb3JkZXJCeTogKHsgX29yZGVyIH0sIHsgYXNjIH0pID0+IFthc2MoX29yZGVyKV0sXG4gICAgICAgICAgICB3aXRoOiB7fSxcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjb25zdCBhcnJheVRhYmxlTmFtZSA9IGFkYXB0ZXIudGFibGVOYW1lTWFwLmdldChcbiAgICAgICAgICAgIGAke2N1cnJlbnRUYWJsZU5hbWV9XyR7dGFibGVQYXRofSR7dG9TbmFrZUNhc2UoZmllbGQubmFtZSl9YCxcbiAgICAgICAgICApXG5cbiAgICAgICAgICBjb25zdCBhcnJheVRhYmxlTmFtZVdpdGhMb2NhbGVzID0gYCR7YXJyYXlUYWJsZU5hbWV9JHthZGFwdGVyLmxvY2FsZXNTdWZmaXh9YFxuXG4gICAgICAgICAgaWYgKGFkYXB0ZXIudGFibGVzW2FycmF5VGFibGVOYW1lV2l0aExvY2FsZXNdKSB3aXRoQXJyYXkud2l0aC5fbG9jYWxlcyA9IF9sb2NhbGVzXG4gICAgICAgICAgY3VycmVudEFyZ3Mud2l0aFtgJHtwYXRofSR7ZmllbGQubmFtZX1gXSA9IHdpdGhBcnJheVxuXG4gICAgICAgICAgdHJhdmVyc2VGaWVsZHMoe1xuICAgICAgICAgICAgX2xvY2FsZXMsXG4gICAgICAgICAgICBhZGFwdGVyLFxuICAgICAgICAgICAgY3VycmVudEFyZ3M6IHdpdGhBcnJheSxcbiAgICAgICAgICAgIGN1cnJlbnRUYWJsZU5hbWU6IGFycmF5VGFibGVOYW1lLFxuICAgICAgICAgICAgZGVwdGgsXG4gICAgICAgICAgICBmaWVsZHM6IGZpZWxkLmZpZWxkcyxcbiAgICAgICAgICAgIHBhdGg6ICcnLFxuICAgICAgICAgICAgdGFibGVQYXRoOiAnJyxcbiAgICAgICAgICAgIHRvcExldmVsQXJncyxcbiAgICAgICAgICAgIHRvcExldmVsVGFibGVOYW1lLFxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICBicmVha1xuICAgICAgICB9XG5cbiAgICAgICAgY2FzZSAnc2VsZWN0Jzoge1xuICAgICAgICAgIGlmIChmaWVsZC5oYXNNYW55KSB7XG4gICAgICAgICAgICBjb25zdCB3aXRoU2VsZWN0OiBSZXN1bHQgPSB7XG4gICAgICAgICAgICAgIGNvbHVtbnM6IHtcbiAgICAgICAgICAgICAgICBpZDogZmFsc2UsXG4gICAgICAgICAgICAgICAgb3JkZXI6IGZhbHNlLFxuICAgICAgICAgICAgICAgIHBhcmVudDogZmFsc2UsXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIG9yZGVyQnk6ICh7IG9yZGVyIH0sIHsgYXNjIH0pID0+IFthc2Mob3JkZXIpXSxcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY3VycmVudEFyZ3Mud2l0aFtgJHtwYXRofSR7ZmllbGQubmFtZX1gXSA9IHdpdGhTZWxlY3RcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBicmVha1xuICAgICAgICB9XG5cbiAgICAgICAgY2FzZSAnYmxvY2tzJzpcbiAgICAgICAgICBmaWVsZC5ibG9ja3MuZm9yRWFjaCgoYmxvY2spID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGJsb2NrS2V5ID0gYF9ibG9ja3NfJHtibG9jay5zbHVnfWBcblxuICAgICAgICAgICAgaWYgKCF0b3BMZXZlbEFyZ3NbYmxvY2tLZXldKSB7XG4gICAgICAgICAgICAgIGNvbnN0IHdpdGhCbG9jazogUmVzdWx0ID0ge1xuICAgICAgICAgICAgICAgIGNvbHVtbnM6IHtcbiAgICAgICAgICAgICAgICAgIF9wYXJlbnRJRDogZmFsc2UsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBvcmRlckJ5OiAoeyBfb3JkZXIgfSwgeyBhc2MgfSkgPT4gW2FzYyhfb3JkZXIpXSxcbiAgICAgICAgICAgICAgICB3aXRoOiB7fSxcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGNvbnN0IHRhYmxlTmFtZSA9IGFkYXB0ZXIudGFibGVOYW1lTWFwLmdldChcbiAgICAgICAgICAgICAgICBgJHt0b3BMZXZlbFRhYmxlTmFtZX1fYmxvY2tzXyR7dG9TbmFrZUNhc2UoYmxvY2suc2x1Zyl9YCxcbiAgICAgICAgICAgICAgKVxuXG4gICAgICAgICAgICAgIGlmIChhZGFwdGVyLnRhYmxlc1tgJHt0YWJsZU5hbWV9JHthZGFwdGVyLmxvY2FsZXNTdWZmaXh9YF0pIHtcbiAgICAgICAgICAgICAgICB3aXRoQmxvY2sud2l0aC5fbG9jYWxlcyA9IF9sb2NhbGVzXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgdG9wTGV2ZWxBcmdzLndpdGhbYmxvY2tLZXldID0gd2l0aEJsb2NrXG5cbiAgICAgICAgICAgICAgdHJhdmVyc2VGaWVsZHMoe1xuICAgICAgICAgICAgICAgIF9sb2NhbGVzLFxuICAgICAgICAgICAgICAgIGFkYXB0ZXIsXG4gICAgICAgICAgICAgICAgY3VycmVudEFyZ3M6IHdpdGhCbG9jayxcbiAgICAgICAgICAgICAgICBjdXJyZW50VGFibGVOYW1lOiB0YWJsZU5hbWUsXG4gICAgICAgICAgICAgICAgZGVwdGgsXG4gICAgICAgICAgICAgICAgdGFibGVQYXRoOiAnJyxcbiAgICAgICAgICAgICAgICBmaWVsZHM6IGJsb2NrLmZpZWxkcyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnJyxcbiAgICAgICAgICAgICAgICB0b3BMZXZlbEFyZ3MsXG4gICAgICAgICAgICAgICAgdG9wTGV2ZWxUYWJsZU5hbWUsXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSlcblxuICAgICAgICAgIGJyZWFrXG5cbiAgICAgICAgY2FzZSAnZ3JvdXAnOlxuICAgICAgICAgIHRyYXZlcnNlRmllbGRzKHtcbiAgICAgICAgICAgIF9sb2NhbGVzLFxuICAgICAgICAgICAgYWRhcHRlcixcbiAgICAgICAgICAgIGN1cnJlbnRBcmdzLFxuICAgICAgICAgICAgY3VycmVudFRhYmxlTmFtZSxcbiAgICAgICAgICAgIHRhYmxlUGF0aDogYCR7dGFibGVQYXRofSR7dG9TbmFrZUNhc2UoZmllbGQubmFtZSl9X2AsXG4gICAgICAgICAgICBkZXB0aCxcbiAgICAgICAgICAgIGZpZWxkczogZmllbGQuZmllbGRzLFxuICAgICAgICAgICAgcGF0aDogYCR7cGF0aH0ke2ZpZWxkLm5hbWV9X2AsXG4gICAgICAgICAgICB0b3BMZXZlbEFyZ3MsXG4gICAgICAgICAgICB0b3BMZXZlbFRhYmxlTmFtZSxcbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgYnJlYWtcblxuICAgICAgICBkZWZhdWx0OiB7XG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfSlcblxuICByZXR1cm4gdG9wTGV2ZWxBcmdzXG59XG4iXSwibmFtZXMiOlsidHJhdmVyc2VGaWVsZHMiLCJfbG9jYWxlcyIsImFkYXB0ZXIiLCJjdXJyZW50QXJncyIsImN1cnJlbnRUYWJsZU5hbWUiLCJkZXB0aCIsImZpZWxkcyIsInBhdGgiLCJ0YWJsZVBhdGgiLCJ0b3BMZXZlbEFyZ3MiLCJ0b3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QztnQ0FDQUMsYUFBYXlDO2dDQUNieEMsa0JBQWtCeUM7Z0NBQ2xCeEM7Z0NBQ0FHLFdBQVc7Z0NBQ1hGLFFBQVFtQyxNQUFNbkMsTUFBTTtnQ0FDcEJDLE1BQU07Z0NBQ05FO2dDQUNBQzs0QkFDRjt3QkFDRjtvQkFDRjtvQkFFQTtnQkFFRixLQUFLO29CQUNIVixlQUFlO3dCQUNiQzt3QkFDQUM7d0JBQ0FDO3dCQUNBQzt3QkFDQUksV0FBVyxDQUFDLEVBQUVBLFVBQVUsRUFBRVksSUFBQUEsb0JBQVcsRUFBQ1IsTUFBTU0sSUFBSSxFQUFFLENBQUMsQ0FBQzt3QkFDcERiO3dCQUNBQyxRQUFRTSxNQUFNTixNQUFNO3dCQUNwQkMsTUFBTSxDQUFDLEVBQUVBLEtBQUssRUFBRUssTUFBTU0sSUFBSSxDQUFDLENBQUMsQ0FBQzt3QkFDN0JUO3dCQUNBQztvQkFDRjtvQkFFQTtnQkFFRjtvQkFBUzt3QkFDUDtvQkFDRjtZQUNGO1FBQ0Y7SUFDRjtJQUVBLE9BQU9EO0FBQ1QifQ==
|
package/dist/init.js
CHANGED
@@ -17,11 +17,12 @@ const init = async function init() {
|
|
17
17
|
this.pgSchema = (0, _pgcore.pgSchema)(this.schemaName);
|
18
18
|
} else {
|
19
19
|
this.pgSchema = {
|
20
|
+
enum: _pgcore.pgEnum,
|
20
21
|
table: _pgcore.pgTable
|
21
22
|
};
|
22
23
|
}
|
23
24
|
if (this.payload.config.localization) {
|
24
|
-
this.enums.enum__locales =
|
25
|
+
this.enums.enum__locales = this.pgSchema.enum('_locales', this.payload.config.localization.locales.map(({ code })=>code));
|
25
26
|
}
|
26
27
|
this.payload.config.collections.forEach((collection)=>{
|
27
28
|
const tableName = (0, _createTableName.createTableName)({
|
@@ -103,4 +104,4 @@ const init = async function init() {
|
|
103
104
|
});
|
104
105
|
};
|
105
106
|
|
106
|
-
//# sourceMappingURL=data:application/json;base64,
|
107
|
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