@payloadcms/db-postgres 0.1.0-beta.9 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +32 -0
- package/dist/connect.d.ts.map +1 -1
- package/dist/connect.js +28 -19
- package/dist/createMigration.d.ts.map +1 -1
- package/dist/createMigration.js +29 -19
- package/dist/createVersion.js +2 -2
- package/dist/extendViteConfig.d.ts +4 -0
- package/dist/extendViteConfig.d.ts.map +1 -0
- package/dist/extendViteConfig.js +38 -0
- package/dist/extendWebpackConfig.d.ts +4 -0
- package/dist/extendWebpackConfig.d.ts.map +1 -0
- package/dist/extendWebpackConfig.js +45 -0
- package/dist/find/buildFindManyArgs.js +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -5
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +2 -4
- package/dist/migrate.d.ts.map +1 -1
- package/dist/migrate.js +63 -39
- package/dist/migrateDown.d.ts +3 -0
- package/dist/migrateDown.d.ts.map +1 -0
- package/dist/migrateDown.js +71 -0
- package/dist/migrateFresh.d.ts +6 -0
- package/dist/migrateFresh.d.ts.map +1 -0
- package/dist/migrateFresh.js +81 -0
- package/dist/migrateRefresh.d.ts +6 -0
- package/dist/migrateRefresh.d.ts.map +1 -0
- package/dist/migrateRefresh.js +109 -0
- package/dist/migrateReset.d.ts +6 -0
- package/dist/migrateReset.d.ts.map +1 -0
- package/dist/migrateReset.js +89 -0
- package/dist/queries/getTableColumnFromPath.js +2 -2
- package/dist/schema/build.d.ts +2 -1
- package/dist/schema/build.d.ts.map +1 -1
- package/dist/schema/build.js +14 -11
- package/dist/schema/createIndex.d.ts +1 -1
- package/dist/schema/createIndex.d.ts.map +1 -1
- package/dist/schema/createIndex.js +12 -3
- package/dist/schema/traverseFields.d.ts.map +1 -1
- package/dist/schema/traverseFields.js +19 -14
- package/dist/transactions/commitTransaction.d.ts.map +1 -1
- package/dist/transactions/commitTransaction.js +1 -2
- package/dist/transform/read/index.js +4 -4
- package/dist/types.d.ts +7 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/update.d.ts.map +1 -1
- package/dist/update.js +51 -5
- package/dist/upsertRow/index.js +2 -2
- package/dist/utilities/createMigrationTable.d.ts.map +1 -1
- package/dist/utilities/createMigrationTable.js +1 -2
- package/dist/utilities/parseError.d.ts +5 -0
- package/dist/utilities/parseError.d.ts.map +1 -0
- package/dist/utilities/parseError.js +24 -0
- package/mock.js +1 -0
- package/package.json +5 -4
- package/dist/mock.js +0 -13
- package/dist/webpack.d.ts +0 -3
- package/dist/webpack.d.ts.map +0 -1
- package/dist/webpack.js +0 -32
- package/src/index.ts +0 -89
package/README.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# Payload Postgres Adapter
|
2
|
+
|
3
|
+
Official Postgres adapter for [Payload](https://payloadcms.com).
|
4
|
+
|
5
|
+
- [Main Repository](https://github.com/payloadcms/payload)
|
6
|
+
- [Payload Docs](https://payloadcms.com/docs)
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
```bash
|
11
|
+
npm install @payloadcms/db-postgres
|
12
|
+
```
|
13
|
+
|
14
|
+
## Usage
|
15
|
+
|
16
|
+
```ts
|
17
|
+
import { buildConfig } from 'payload/config'
|
18
|
+
import { postgresAdapter } from '@payloadcms/db-postgres'
|
19
|
+
|
20
|
+
export default buildConfig({
|
21
|
+
db: postgresAdapter({
|
22
|
+
pool: {
|
23
|
+
connectionString: process.env.DATABASE_URI,
|
24
|
+
}
|
25
|
+
}),
|
26
|
+
// ...rest of config
|
27
|
+
})
|
28
|
+
|
29
|
+
```
|
30
|
+
|
31
|
+
More detailed usage can be found in the [Payload Docs](https://payloadcms.com/docs/configuration/overview).
|
32
|
+
|
package/dist/connect.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;
|
1
|
+
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAW/C,eAAO,MAAM,OAAO,EAAE,OA+FrB,CAAA"}
|
package/dist/connect.js
CHANGED
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "connect", {
|
|
11
11
|
const _utils = require("drizzle-kit/utils");
|
12
12
|
const _drizzleorm = require("drizzle-orm");
|
13
13
|
const _nodepostgres = require("drizzle-orm/node-postgres");
|
14
|
+
const _pgcore = require("drizzle-orm/pg-core");
|
14
15
|
const _pg = require("pg");
|
15
16
|
const _prompts = /*#__PURE__*/ _interop_require_default(require("prompts"));
|
16
17
|
function _interop_require_default(obj) {
|
@@ -25,45 +26,35 @@ const connect = async function connect(payload) {
|
|
25
26
|
...this.enums
|
26
27
|
};
|
27
28
|
try {
|
28
|
-
this.pool = new _pg.Pool(this.
|
29
|
+
this.pool = new _pg.Pool(this.poolOptions);
|
29
30
|
await this.pool.connect();
|
30
31
|
this.drizzle = (0, _nodepostgres.drizzle)(this.pool, {
|
31
32
|
schema: this.schema
|
32
33
|
});
|
33
34
|
if (process.env.PAYLOAD_DROP_DATABASE === 'true') {
|
34
35
|
this.payload.logger.info('---- DROPPING TABLES ----');
|
35
|
-
await this.drizzle.execute((0, _drizzleorm.sql)`drop schema public cascade
|
36
|
+
await this.drizzle.execute((0, _drizzleorm.sql)`drop schema public cascade;
|
37
|
+
create schema public;`);
|
36
38
|
this.payload.logger.info('---- DROPPED TABLES ----');
|
37
39
|
}
|
38
40
|
} catch (err) {
|
39
41
|
payload.logger.error(`Error: cannot connect to Postgres. Details: ${err.message}`, err);
|
40
42
|
process.exit(1);
|
41
43
|
}
|
42
|
-
this.payload.logger.info('Connected to Postgres successfully');
|
43
44
|
// Only push schema if not in production
|
44
|
-
if (process.env.NODE_ENV === 'production' || process.env.PAYLOAD_MIGRATING === 'true') return;
|
45
|
+
if (process.env.NODE_ENV === 'production' || process.env.PAYLOAD_MIGRATING === 'true' || this.push === false) return;
|
45
46
|
// This will prompt if clarifications are needed for Drizzle to push new schema
|
46
47
|
const { apply, hasDataLoss, statementsToExecute, warnings } = await (0, _utils.pushSchema)(this.schema, this.drizzle);
|
47
|
-
// this.payload.logger.debug({
|
48
|
-
// hasDataLoss,
|
49
|
-
// msg: 'Schema push results',
|
50
|
-
// statementsToExecute,
|
51
|
-
// warnings,
|
52
|
-
// })
|
53
48
|
if (warnings.length) {
|
54
|
-
|
55
|
-
msg: `Warnings detected during schema push: ${warnings.join('\n')}`,
|
56
|
-
warnings
|
57
|
-
});
|
49
|
+
let message = `Warnings detected during schema push: \n\n${warnings.join('\n')}\n\n`;
|
58
50
|
if (hasDataLoss) {
|
59
|
-
|
60
|
-
msg: 'DATA LOSS WARNING: Possible data loss detected if schema is pushed.'
|
61
|
-
});
|
51
|
+
message += `DATA LOSS WARNING: Possible data loss detected if schema is pushed.\n\n`;
|
62
52
|
}
|
53
|
+
message += `Accept warnings and push schema to database?`;
|
63
54
|
const { confirm: acceptWarnings } = await (0, _prompts.default)({
|
64
55
|
name: 'confirm',
|
65
56
|
initial: false,
|
66
|
-
message
|
57
|
+
message,
|
67
58
|
type: 'confirm'
|
68
59
|
}, {
|
69
60
|
onCancel: ()=>{
|
@@ -77,6 +68,24 @@ const connect = async function connect(payload) {
|
|
77
68
|
}
|
78
69
|
}
|
79
70
|
await apply();
|
71
|
+
// Migration table def in order to use query using drizzle
|
72
|
+
const migrationsSchema = (0, _pgcore.pgTable)('payload_migrations', {
|
73
|
+
name: (0, _pgcore.varchar)('name'),
|
74
|
+
batch: (0, _pgcore.numeric)('batch'),
|
75
|
+
created_at: (0, _pgcore.timestamp)('created_at'),
|
76
|
+
updated_at: (0, _pgcore.timestamp)('updated_at')
|
77
|
+
});
|
78
|
+
const devPush = await this.drizzle.select().from(migrationsSchema).where((0, _drizzleorm.eq)(migrationsSchema.batch, '-1'));
|
79
|
+
if (!devPush.length) {
|
80
|
+
await this.drizzle.insert(migrationsSchema).values({
|
81
|
+
name: 'dev',
|
82
|
+
batch: '-1'
|
83
|
+
});
|
84
|
+
} else {
|
85
|
+
await this.drizzle.update(migrationsSchema).set({
|
86
|
+
updated_at: new Date()
|
87
|
+
}).where((0, _drizzleorm.eq)(migrationsSchema.batch, '-1'));
|
88
|
+
}
|
80
89
|
};
|
81
90
|
|
82
|
-
//# sourceMappingURL=data:application/json;base64,
|
91
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jb25uZWN0LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgQ29ubmVjdCB9IGZyb20gJ3BheWxvYWQvZGF0YWJhc2UnXG5cbmltcG9ydCB7IHB1c2hTY2hlbWEgfSBmcm9tICdkcml6emxlLWtpdC91dGlscydcbmltcG9ydCB7IGVxLCBzcWwgfSBmcm9tICdkcml6emxlLW9ybSdcbmltcG9ydCB7IGRyaXp6bGUgfSBmcm9tICdkcml6emxlLW9ybS9ub2RlLXBvc3RncmVzJ1xuaW1wb3J0IHsgbnVtZXJpYywgcGdUYWJsZSwgdGltZXN0YW1wLCB2YXJjaGFyIH0gZnJvbSAnZHJpenpsZS1vcm0vcGctY29yZSdcbmltcG9ydCB7IFBvb2wgfSBmcm9tICdwZydcbmltcG9ydCBwcm9tcHRzIGZyb20gJ3Byb21wdHMnXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi90eXBlcydcblxuZXhwb3J0IGNvbnN0IGNvbm5lY3Q6IENvbm5lY3QgPSBhc3luYyBmdW5jdGlvbiBjb25uZWN0KHRoaXM6IFBvc3RncmVzQWRhcHRlciwgcGF5bG9hZCkge1xuICB0aGlzLnNjaGVtYSA9IHtcbiAgICAuLi50aGlzLnRhYmxlcyxcbiAgICAuLi50aGlzLnJlbGF0aW9ucyxcbiAgICAuLi50aGlzLmVudW1zLFxuICB9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ixpQkFBaUJHLEtBQUssRUFBRTtJQUVwQyxJQUFJLENBQUNLLFFBQVFqQixNQUFNLEVBQUU7UUFDbkIsTUFBTSxJQUFJLENBQUNwQixPQUFPLENBQUMwQyxNQUFNLENBQUNiLGtCQUFrQmMsTUFBTSxDQUFDO1lBQ2pEbEIsTUFBTTtZQUNOTyxPQUFPO1FBQ1Q7SUFDRixPQUFPO1FBQ0wsTUFBTSxJQUFJLENBQUNoQyxPQUFPLENBQ2Y0QyxNQUFNLENBQUNmLGtCQUNQZ0IsR0FBRyxDQUFDO1lBQ0hULFlBQVksSUFBSVU7UUFDbEIsR0FDQ04sS0FBSyxDQUFDQyxJQUFBQSxjQUFFLEVBQUNaLGlCQUFpQkcsS0FBSyxFQUFFO0lBQ3RDO0FBQ0YifQ==
|
@@ -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,eA0E7B,CAAA"}
|
package/dist/createMigration.js
CHANGED
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "createMigration", {
|
|
10
10
|
});
|
11
11
|
const _utils = require("drizzle-kit/utils");
|
12
12
|
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
13
|
-
const
|
13
|
+
const _prompts = /*#__PURE__*/ _interop_require_default(require("prompts"));
|
14
14
|
function _interop_require_default(obj) {
|
15
15
|
return obj && obj.__esModule ? obj : {
|
16
16
|
default: obj
|
@@ -47,10 +47,7 @@ const getDefaultDrizzleSnapshot = ()=>({
|
|
47
47
|
tables: {},
|
48
48
|
version: '5'
|
49
49
|
});
|
50
|
-
const createMigration = async function createMigration(
|
51
|
-
payload.logger.info({
|
52
|
-
msg: 'Creating new migration...'
|
53
|
-
});
|
50
|
+
const createMigration = async function createMigration({ migrationName, payload }) {
|
54
51
|
const dir = payload.db.migrationDir;
|
55
52
|
if (!_fs.default.existsSync(dir)) {
|
56
53
|
_fs.default.mkdirSync(dir);
|
@@ -59,27 +56,40 @@ const createMigration = async function createMigration(payload, migrationName) {
|
|
59
56
|
const formattedDate = yyymmdd.replace(/\D/g, '');
|
60
57
|
const formattedTime = hhmmss.split('.')[0].replace(/\D/g, '');
|
61
58
|
const timestamp = `${formattedDate}_${formattedTime}`;
|
62
|
-
const fileName = migrationName ? `${timestamp}_${migrationName.replace(/\W/g, '_')}
|
59
|
+
const fileName = migrationName ? `${timestamp}_${migrationName.replace(/\W/g, '_')}` : `${timestamp}`;
|
63
60
|
const filePath = `${dir}/${fileName}`;
|
64
61
|
let drizzleJsonBefore = getDefaultDrizzleSnapshot();
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
sort: '-name'
|
71
|
-
});
|
72
|
-
if (migrationQuery.docs?.[0]?.schema) {
|
73
|
-
drizzleJsonBefore = migrationQuery.docs[0]?.schema;
|
74
|
-
}
|
62
|
+
// Get latest migration snapshot
|
63
|
+
const latestSnapshot = _fs.default.readdirSync(dir).filter((file)=>file.endsWith('.json')).sort().reverse()?.[0];
|
64
|
+
if (latestSnapshot) {
|
65
|
+
const latestSnapshotJSON = JSON.parse(_fs.default.readFileSync(`${dir}/${latestSnapshot}`, 'utf8'));
|
66
|
+
drizzleJsonBefore = latestSnapshotJSON;
|
75
67
|
}
|
76
68
|
const drizzleJsonAfter = (0, _utils.generateDrizzleJson)(this.schema);
|
77
69
|
const sqlStatementsUp = await (0, _utils.generateMigration)(drizzleJsonBefore, drizzleJsonAfter);
|
78
70
|
const sqlStatementsDown = await (0, _utils.generateMigration)(drizzleJsonAfter, drizzleJsonBefore);
|
79
|
-
|
71
|
+
if (!sqlStatementsUp.length && !sqlStatementsDown.length) {
|
72
|
+
const { confirm: shouldCreateBlankMigration } = await (0, _prompts.default)({
|
73
|
+
name: 'confirm',
|
74
|
+
initial: false,
|
75
|
+
message: 'No schema changes detected. Would you like to create a blank migration file?',
|
76
|
+
type: 'confirm'
|
77
|
+
}, {
|
78
|
+
onCancel: ()=>{
|
79
|
+
process.exit(0);
|
80
|
+
}
|
81
|
+
});
|
82
|
+
if (!shouldCreateBlankMigration) {
|
83
|
+
process.exit(0);
|
84
|
+
}
|
85
|
+
}
|
86
|
+
// write schema
|
87
|
+
_fs.default.writeFileSync(`${filePath}.json`, JSON.stringify(drizzleJsonAfter, null, 2));
|
88
|
+
// write migration
|
89
|
+
_fs.default.writeFileSync(`${filePath}.ts`, migrationTemplate(sqlStatementsUp.length ? sqlStatementsUp?.join('\n') : undefined, sqlStatementsDown.length ? sqlStatementsDown?.join('\n') : undefined));
|
80
90
|
payload.logger.info({
|
81
|
-
msg: `Migration created at ${filePath}`
|
91
|
+
msg: `Migration created at ${filePath}.ts`
|
82
92
|
});
|
83
93
|
};
|
84
94
|
|
85
|
-
//# sourceMappingURL=data:application/json;base64,
|
95
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jcmVhdGVNaWdyYXRpb24udHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tcmVzdHJpY3RlZC1zeW50YXgsIG5vLWF3YWl0LWluLWxvb3AgKi9cbmltcG9ydCB0eXBlIHsgRHJpenpsZVNuYXBzaG90SlNPTiB9IGZyb20gJ2RyaXp6bGUta2l0L3V0aWxzJ1xuaW1wb3J0IHR5cGUgeyBDcmVhdGVNaWdyYXRpb24gfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuXG5pbXBvcnQgeyBnZW5lcmF0ZURyaXp6bGVKc29uLCBnZW5lcmF0ZU1pZ3JhdGlvbiB9IGZyb20gJ2R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NKLGtCQUFrQlo7SUFFcEUsSUFBSSxDQUFDZSxnQkFBZ0JHLE1BQU0sSUFBSSxDQUFDRCxrQkFBa0JDLE1BQU0sRUFBRTtRQUN4RCxNQUFNLEVBQUVDLFNBQVNDLDBCQUEwQixFQUFFLEdBQUcsTUFBTUMsSUFBQUEsZ0JBQU8sRUFDM0Q7WUFDRUMsTUFBTTtZQUNOQyxTQUFTO1lBQ1RDLFNBQVM7WUFDVEMsTUFBTTtRQUNSLEdBQ0E7WUFDRUMsVUFBVTtnQkFDUkMsUUFBUUMsSUFBSSxDQUFDO1lBQ2Y7UUFDRjtRQUdGLElBQUksQ0FBQ1IsNEJBQTRCO1lBQy9CTyxRQUFRQyxJQUFJLENBQUM7UUFDZjtJQUNGO0lBRUEsZUFBZTtJQUNmMUMsV0FBRSxDQUFDMkMsYUFBYSxDQUFDLENBQUMsRUFBRTlCLFNBQVMsS0FBSyxDQUFDLEVBQUVVLEtBQUtxQixTQUFTLENBQUNsQixrQkFBa0IsTUFBTTtJQUU1RSxrQkFBa0I7SUFDbEIxQixXQUFFLENBQUMyQyxhQUFhLENBQ2QsQ0FBQyxFQUFFOUIsU0FBUyxHQUFHLENBQUMsRUFDaEIvQixrQkFDRStDLGdCQUFnQkcsTUFBTSxHQUFHSCxpQkFBaUJnQixLQUFLLFFBQVFDLFdBQ3ZEZixrQkFBa0JDLE1BQU0sR0FBR0QsbUJBQW1CYyxLQUFLLFFBQVFDO0lBRy9EbEQsUUFBUW1ELE1BQU0sQ0FBQ0MsSUFBSSxDQUFDO1FBQUVDLEtBQUssQ0FBQyxxQkFBcUIsRUFBRXBDLFNBQVMsR0FBRyxDQUFDO0lBQUM7QUFDbkUifQ==
|
package/dist/createVersion.js
CHANGED
@@ -36,7 +36,7 @@ async function createVersion({ autosave, collectionSlug, parent, req = {}, versi
|
|
36
36
|
tableName
|
37
37
|
});
|
38
38
|
const table = this.tables[tableName];
|
39
|
-
const relationshipsTable = this.tables[`${tableName}
|
39
|
+
const relationshipsTable = this.tables[`${tableName}_rels`];
|
40
40
|
if (collection.versions.drafts) {
|
41
41
|
await db.execute((0, _drizzleorm.sql)`
|
42
42
|
UPDATE ${table}
|
@@ -51,4 +51,4 @@ async function createVersion({ autosave, collectionSlug, parent, req = {}, versi
|
|
51
51
|
return result;
|
52
52
|
}
|
53
53
|
|
54
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jcmVhdGVWZXJzaW9uLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgQ3JlYXRlVmVyc2lvbkFyZ3MsIFR5cGVXaXRoVmVyc2lvbiB9IGZyb20gJ3BheWxvYWQvZGF0YWJhc2UnXG5pbXBvcnQgdHlwZSB7IFBheWxvYWRSZXF1ZXN0LCBUeXBlV2l0aElEIH0gZnJvbSAncGF5bG9hZC90eXBlcydcblxuaW1wb3J0IHsgc3FsIH0gZnJvbSAnZHJpenpsZS1vcm0nXG5pbXBvcnQgeyBidWlsZFZlcnNpb25Db2xsZWN0aW9uRmllbGRzIH0gZnJvbSAncGF5bG9hZC92ZXJzaW9ucydcbmltcG9ydCB0b1NuYWtlQ2FzZSBmcm9tICd0by1zbmFrZS1jYXNlJ1xuXG5pbXBvcnQgdHlwZSB7IFBvc3RncmVzQWRhcHRlciB9IGZyb20gJy4vdHlwZXMnXG5cbmltcG9ydCB7IHVwc2VydFJvdyB9IGZyb20gJy4vdXBzZXJ0Um93J1xuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gY3JlYXRlVmVyc2lvbjxUIGV4dGVuZHMgVHlwZVdpdGhJRD4oXG4gIHRoaXM6IFBvc3RncmVzQWRhcHRlcixcbiAge1xuICAgIGF1dG9zYXZlLFxuICAgIGNvbGxlY3Rpb25TbHVnLFxuICAgIHBhcmVudCxcbiAgICByZXEgPSB7fSBhcyBQYXlsb2FkUmVxdWVzdCxcbiAgICB2ZXJzaW9uRGF0YSxcbiA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4sV0FBV21CLFFBQVEsQ0FBQ0MsTUFBTSxFQUFFO1FBQzlCLE1BQU14QixHQUFHeUIsT0FBTyxDQUFDQyxJQUFBQSxlQUFHLENBQUEsQ0FBQzthQUNaLEVBQUVOLE1BQU07O1dBRVYsRUFBRUUsbUJBQW1CO1lBQ3BCLEVBQUVGLE1BQU1PLEVBQUUsQ0FBQyxHQUFHLEVBQUVMLG1CQUFtQnpCLE1BQU0sQ0FBQztZQUMxQyxFQUFFeUIsbUJBQW1CTSxJQUFJLENBQUMsR0FBRyxFQUFFLFNBQVM7WUFDeEMsRUFBRU4sa0JBQWtCLENBQUMsQ0FBQyxFQUFFMUIsZUFBZSxFQUFFLENBQUMsQ0FBQyxDQUFDLEdBQUcsRUFBRUMsT0FBTztZQUN4RCxFQUFFdUIsTUFBTU8sRUFBRSxDQUFDLElBQUksRUFBRWhCLE9BQU9nQixFQUFFLENBQUM7RUFDckMsQ0FBQztJQUNEO0lBRUEsT0FBT2hCO0FBQ1QifQ==
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"extendViteConfig.d.ts","sourceRoot":"","sources":["../src/extendViteConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD,eAAO,MAAM,IAAI,sBAQhB,CAAA;AAED,eAAO,MAAM,gBAAgB,WAAY,eAAe,SAMvD,CAAA"}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
function _export(target, all) {
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
7
|
+
enumerable: true,
|
8
|
+
get: all[name]
|
9
|
+
});
|
10
|
+
}
|
11
|
+
_export(exports, {
|
12
|
+
vite: function() {
|
13
|
+
return vite;
|
14
|
+
},
|
15
|
+
extendViteConfig: function() {
|
16
|
+
return extendViteConfig;
|
17
|
+
}
|
18
|
+
});
|
19
|
+
const vite = (config)=>{
|
20
|
+
return {
|
21
|
+
...config,
|
22
|
+
optimizeDeps: {
|
23
|
+
...config.optimizeDeps,
|
24
|
+
exclude: [
|
25
|
+
...config.optimizeDeps.exclude,
|
26
|
+
'@payloadcms/db-postgres'
|
27
|
+
]
|
28
|
+
}
|
29
|
+
};
|
30
|
+
};
|
31
|
+
const extendViteConfig = (config)=>{
|
32
|
+
const existingViteConfig = config.admin.vite ? config.admin.vite : (viteConfig)=>viteConfig;
|
33
|
+
config.admin.vite = (webpackConfig)=>{
|
34
|
+
return vite(existingViteConfig(webpackConfig));
|
35
|
+
};
|
36
|
+
};
|
37
|
+
|
38
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9leHRlbmRWaXRlQ29uZmlnLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgU2FuaXRpemVkQ29uZmlnIH0gZnJvbSAncGF5bG9hZC9jb25maWcnXG5cbmV4cG9ydCBjb25zdCB2aXRlID0gKGNvbmZpZykgPT4ge1xuICByZXR1cm4ge1xuICAgIC4uLmNvbmZpZyxcbiAgICBvcHRpbWl6ZURlcHM6IHtcbiAgICAgIC4uLmNvbmZpZy5vcHRpbWl6ZURlcHMsXG4gICAgICBleGNsdWRlOiBbLi4uY29uZmlnLm9wdGltaXplRGVwcy5leGNsdWRlLCAnQHBheWxvYWRjbXMvZGItcG9zdGdyZXMnXSxcbiAgICB9LFxuICB9XG59XG5cbmV4cG9ydCBjb25zdCBleHRlbmRWaXRlQ29uZmlnID0gKGNvbmZpZzogU2FuaXRpemVkQ29uZmlnKSA9PiB7XG4gIGNvbnN0IGV4aXN0aW5nVml0ZUNvbmZpZyA9IGNvbmZpZy5hZG1pbi52aXRlID8gY29uZmlnLmFkbWluLnZpdGUgOiAodml0ZUNvbmZpZykgPT4gdml0ZUNvbmZpZ1xuXG4gIGNvbmZpZy5hZG1pbi52aXRlID0gK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1,45 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
function _export(target, all) {
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
7
|
+
enumerable: true,
|
8
|
+
get: all[name]
|
9
|
+
});
|
10
|
+
}
|
11
|
+
_export(exports, {
|
12
|
+
webpack: function() {
|
13
|
+
return webpack;
|
14
|
+
},
|
15
|
+
extendWebpackConfig: function() {
|
16
|
+
return extendWebpackConfig;
|
17
|
+
}
|
18
|
+
});
|
19
|
+
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
20
|
+
function _interop_require_default(obj) {
|
21
|
+
return obj && obj.__esModule ? obj : {
|
22
|
+
default: obj
|
23
|
+
};
|
24
|
+
}
|
25
|
+
const webpack = (config)=>{
|
26
|
+
const aliasPath = _path.default.resolve(__dirname, '../mock.js');
|
27
|
+
return {
|
28
|
+
...config,
|
29
|
+
resolve: {
|
30
|
+
...config.resolve || {},
|
31
|
+
alias: {
|
32
|
+
...config.resolve?.alias || {},
|
33
|
+
'@payloadcms/db-postgres': aliasPath
|
34
|
+
}
|
35
|
+
}
|
36
|
+
};
|
37
|
+
};
|
38
|
+
const extendWebpackConfig = (config)=>{
|
39
|
+
const existingWebpackConfig = config.admin.webpack ? config.admin.webpack : (webpackConfig)=>webpackConfig;
|
40
|
+
config.admin.webpack = (webpackConfig)=>{
|
41
|
+
return webpack(existingWebpackConfig(webpackConfig));
|
42
|
+
};
|
43
|
+
};
|
44
|
+
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9leHRlbmRXZWJwYWNrQ29uZmlnLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgU2FuaXRpemVkQ29uZmlnIH0gZnJvbSAncGF5bG9hZC9jb25maWcnXG5cbmltcG9ydCBwYXRoIGZyb20gJ3BhdGgnXG5cb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uQkE7Ozs2REFqQkk7Ozs7OztBQUVWLE1BQU1ELFVBQVUsQ0FBQ0U7SUFDdEIsTUFBTUMsWUFBWUMsYUFBSSxDQUFDQyxPQUFPLENBQUNDLFdBQVc7SUFFMUMsT0FBTztRQUNMLEdBQUdKLE1BQU07UUFDVEcsU0FBUztZQUNQLEdBQUlILE9BQU9HLE9BQU8sSUFBSSxDQUFDLENBQUM7WUFDeEJFLE9BQU87Z0JBQ0wsR0FBSUwsT0FBT0csT0FBTyxFQUFFRSxTQUFTLENBQUMsQ0FBQztnQkFDL0IsMkJBQTJCSjtZQUM3QjtRQUNGO0lBQ0Y7QUFDRjtBQUVPLE1BQU1GLHNCQUFzQixDQUFDQztJQUNsQyxNQUFNTSx3QkFBd0JOLE9BQU9PLEtBQUssQ0FBQ1QsT0FBTyxHQUM5Q0UsT0FBT08sS0FBSyxDQUFDVCxPQUFPLEdBQ3BCLENBQUNVLGdCQUFrQkE7SUFFdkJSLE9BQU9PLEtBQUssQ0FBQ1QsT0FBTyxHQUFHLENBQUNVO1FBQ3RCLE9BQU9WLFFBQVFRLHNCQUFzQkU7SUFDdkM7QUFDRiJ9
|
@@ -30,8 +30,8 @@ const buildFindManyArgs = ({ adapter, depth, fields, tableName })=>{
|
|
30
30
|
]
|
31
31
|
};
|
32
32
|
}
|
33
|
-
if (adapter.tables[`${tableName}
|
34
|
-
result.with.
|
33
|
+
if (adapter.tables[`${tableName}_rels`]) {
|
34
|
+
result.with._rels = {
|
35
35
|
columns: {
|
36
36
|
id: false,
|
37
37
|
parent: false
|
@@ -58,4 +58,4 @@ const buildFindManyArgs = ({ adapter, depth, fields, tableName })=>{
|
|
58
58
|
return result;
|
59
59
|
};
|
60
60
|
|
61
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maW5kL2J1aWxkRmluZE1hbnlBcmdzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eX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BUTtZQUNWO1lBQ0FDLFNBQVMsQ0FBQyxFQUFFQyxLQUFLLEVBQUUsRUFBRSxFQUFFQyxLQUFLQyxHQUFHLEVBQUUsR0FBSztvQkFBQ0EsSUFBSUY7aUJBQU87UUFDcEQ7SUFDRjtJQUVBLElBQUlkLFFBQVFVLE1BQU0sQ0FBQyxDQUFDLEVBQUVQLFVBQVUsS0FBSyxDQUFDLENBQUMsRUFBRTtRQUN2Q0MsT0FBT0MsSUFBSSxDQUFDWSxLQUFLLEdBQUc7WUFDbEJWLFNBQVM7Z0JBQ1BDLElBQUk7Z0JBQ0pJLFFBQVE7WUFDVjtZQUNBQyxTQUFTLENBQUMsRUFBRUMsS0FBSyxFQUFFLEVBQUUsRUFBRUMsS0FBS0MsR0FBRyxFQUFFLEdBQUs7b0JBQUNBLElBQUlGO2lCQUFPO1FBQ3BEO0lBQ0Y7SUFFQSxJQUFJZCxRQUFRVSxNQUFNLENBQUMsQ0FBQyxFQUFFUCxVQUFVLFFBQVEsQ0FBQyxDQUFDLEVBQUU7UUFDMUNDLE9BQU9DLElBQUksQ0FBQ0MsUUFBUSxHQUFHQTtJQUN6QjtJQUVBWSxJQUFBQSw4QkFBYyxFQUFDO1FBQ2JaO1FBQ0FOO1FBQ0FtQixhQUFhZjtRQUNiZ0Isa0JBQWtCakI7UUFDbEJGO1FBQ0FDO1FBQ0FtQixNQUFNO1FBQ05DLGNBQWNsQjtRQUNkbUIsbUJBQW1CcEI7SUFDckI7SUFFQSxPQUFPQztBQUNUIn0=
|
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAmB,qBAAqB,EAAE,MAAM,SAAS,CAAA;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAmB,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAmC3E,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE7D,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,qBAAqB,CA2DjE"}
|
package/dist/index.js
CHANGED
@@ -20,6 +20,8 @@ const _deleteMany = require("./deleteMany");
|
|
20
20
|
const _deleteOne = require("./deleteOne");
|
21
21
|
const _deleteVersions = require("./deleteVersions");
|
22
22
|
const _destroy = require("./destroy");
|
23
|
+
const _extendViteConfig = require("./extendViteConfig");
|
24
|
+
const _extendWebpackConfig = require("./extendWebpackConfig");
|
23
25
|
const _find = require("./find");
|
24
26
|
const _findGlobal = require("./findGlobal");
|
25
27
|
const _findGlobalVersions = require("./findGlobalVersions");
|
@@ -27,6 +29,10 @@ const _findOne = require("./findOne");
|
|
27
29
|
const _findVersions = require("./findVersions");
|
28
30
|
const _init = require("./init");
|
29
31
|
const _migrate = require("./migrate");
|
32
|
+
const _migrateDown = require("./migrateDown");
|
33
|
+
const _migrateFresh = require("./migrateFresh");
|
34
|
+
const _migrateRefresh = require("./migrateRefresh");
|
35
|
+
const _migrateReset = require("./migrateReset");
|
30
36
|
const _migrateStatus = require("./migrateStatus");
|
31
37
|
const _queryDrafts = require("./queryDrafts");
|
32
38
|
const _beginTransaction = require("./transactions/beginTransaction");
|
@@ -36,7 +42,6 @@ const _update = require("./update");
|
|
36
42
|
const _updateGlobal = require("./updateGlobal");
|
37
43
|
const _updateGlobalVersion = require("./updateGlobalVersion");
|
38
44
|
const _updateVersion = require("./updateVersion");
|
39
|
-
const _webpack = require("./webpack");
|
40
45
|
function _interop_require_default(obj) {
|
41
46
|
return obj && obj.__esModule ? obj : {
|
42
47
|
default: obj
|
@@ -45,13 +50,16 @@ function _interop_require_default(obj) {
|
|
45
50
|
function postgresAdapter(args) {
|
46
51
|
function adapter({ payload }) {
|
47
52
|
const migrationDir = args.migrationDir || _path.default.resolve(process.cwd(), 'src/migrations');
|
53
|
+
(0, _extendWebpackConfig.extendWebpackConfig)(payload.config);
|
54
|
+
(0, _extendViteConfig.extendViteConfig)(payload.config);
|
48
55
|
return (0, _database.createDatabaseAdapter)({
|
49
|
-
...args,
|
50
56
|
name: 'postgres',
|
51
57
|
// Postgres-specific
|
52
58
|
drizzle: undefined,
|
53
59
|
enums: {},
|
54
60
|
pool: undefined,
|
61
|
+
poolOptions: args.pool,
|
62
|
+
push: args.push,
|
55
63
|
relations: {},
|
56
64
|
schema: {},
|
57
65
|
sessions: {},
|
@@ -77,6 +85,10 @@ function postgresAdapter(args) {
|
|
77
85
|
findVersions: _findVersions.findVersions,
|
78
86
|
init: _init.init,
|
79
87
|
migrate: _migrate.migrate,
|
88
|
+
migrateDown: _migrateDown.migrateDown,
|
89
|
+
migrateFresh: _migrateFresh.migrateFresh,
|
90
|
+
migrateRefresh: _migrateRefresh.migrateRefresh,
|
91
|
+
migrateReset: _migrateReset.migrateReset,
|
80
92
|
migrateStatus: _migrateStatus.migrateStatus,
|
81
93
|
migrationDir,
|
82
94
|
payload,
|
@@ -85,11 +97,10 @@ function postgresAdapter(args) {
|
|
85
97
|
updateGlobal: _updateGlobal.updateGlobal,
|
86
98
|
updateGlobalVersion: _updateGlobalVersion.updateGlobalVersion,
|
87
99
|
updateOne: _update.updateOne,
|
88
|
-
updateVersion: _updateVersion.updateVersion
|
89
|
-
webpack: _webpack.webpack
|
100
|
+
updateVersion: _updateVersion.updateVersion
|
90
101
|
});
|
91
102
|
}
|
92
103
|
return adapter;
|
93
104
|
}
|
94
105
|
|
95
|
-
//# sourceMappingURL=data:application/json;base64,
|
106
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IFBheWxvYWQgfSBmcm9tICdwYXlsb2FkJ1xuXG5pbXBvcnQgcGF0aCBmcm9tICdwYXR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LDhCQUFjO1lBQ2RDLFNBQUFBLGdCQUFPO1lBQ1BDLE1BQUFBLFVBQUk7WUFDSkMsWUFBQUEsc0JBQVU7WUFDVkMsb0JBQUFBLHNDQUFrQjtZQUNsQkMsU0FBQUEsZ0JBQU87WUFDUEMsY0FBQUEsMEJBQVk7WUFDWkMsTUFBQUEsVUFBSTtZQUNKQyxTQUFBQSxnQkFBTztZQUNQQyxhQUFBQSx3QkFBVztZQUNYQyxjQUFBQSwwQkFBWTtZQUNaQyxnQkFBQUEsOEJBQWM7WUFDZEMsY0FBQUEsMEJBQVk7WUFDWkMsZUFBQUEsNEJBQWE7WUFDYjVDO1lBQ0FEO1lBQ0E4QyxhQUFBQSx3QkFBVztZQUNYQyxxQkFBQUEsd0NBQW1CO1lBQ25CQyxjQUFBQSwwQkFBWTtZQUNaQyxxQkFBQUEsd0NBQW1CO1lBQ25CQyxXQUFBQSxpQkFBUztZQUNUQyxlQUFBQSw0QkFBYTtRQUNmO0lBQ0Y7SUFFQSxPQUFPcEQ7QUFDVCJ9
|
package/dist/init.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAW5C,eAAO,MAAM,IAAI,EAAE,
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAW5C,eAAO,MAAM,IAAI,EAAE,IA6DlB,CAAA"}
|
package/dist/init.js
CHANGED
@@ -19,9 +19,7 @@ function _interop_require_default(obj) {
|
|
19
19
|
}
|
20
20
|
const init = async function init() {
|
21
21
|
if (this.payload.config.localization) {
|
22
|
-
this.enums.enum__locales = (0, _pgcore.pgEnum)('_locales',
|
23
|
-
// this.payload.config.localization.localeCodes,
|
24
|
-
this.payload.config.localization.locales.map(({ code })=>code));
|
22
|
+
this.enums.enum__locales = (0, _pgcore.pgEnum)('_locales', this.payload.config.localization.locales.map(({ code })=>code));
|
25
23
|
}
|
26
24
|
this.payload.config.collections.forEach((collection)=>{
|
27
25
|
const tableName = (0, _tosnakecase.default)(collection.slug);
|
@@ -71,4 +69,4 @@ const init = async function init() {
|
|
71
69
|
});
|
72
70
|
};
|
73
71
|
|
74
|
-
//# sourceMappingURL=data:application/json;base64,
|
72
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbml0LnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLXBhcmFtLXJlYXNzaWduICovXG5pbXBvcnQgdHlwZSB7IEluaXQgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuaW1wb3J0IHR5cGUgeyBTYW5pdGl6ZWRDb2xsZWN0aW9uQ29uZmlnIH0gZnJvbSAncGF5bG9hZC90eXBlcydcblxuaW1wb3J0IHsgcGdFbnVtIH0gZnJvbSAnZHJpenpsZS1vcm0vcGctY29yZSdcbmltcG9ydCB7IGJ1aWxkVmVyc2lvbkNvbGxlY3Rpb25GaWVsZHMsIGJ1aWxkVmVyc2lvbkdsb2JhbEZpZWxkcyB9IGZyb20gJ3BheWxvYWQvdmVyc2lvbnMnXG5pbXBvcnQgdG9TbmFrZUNhc2UgZnJvbSAndG8tc25ha2UtY2FzZSdcblxuaW1wb3J0IHR5cGUgeyBQb3N0Z3Jlc0FkYXB0ZXIgfSBmcm9tICcuL3R5cGVzJ1xuXG5pbXBvcnQgeyBidWlsZFRhYmxlIH0gZnJvbSAnLi9zY2hlbWEvYnVpbGQnXG5cbmV4cG9ydCBjb25zdCBpbml0OiBJbml0ID0gYXN5bmMgZnVuY3Rpb24gaW5pdCh0aGlzOiBQb3N0Z3Jlc0FkYXB0ZXIpIHtcbiAgaWYgKHRoaXMucGF5bG9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tnQkFDUlgsV0FBV1U7Z0JBQ1hGLFlBQVk7WUFDZDtRQUNGO0lBQ0Y7QUFDRiJ9
|
package/dist/migrate.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../src/migrate.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../src/migrate.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAM9C,wBAAsB,OAAO,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA8DlE"}
|