@payloadcms/db-postgres 0.1.0-beta.0 → 0.1.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/createMigration.js +2 -2
- package/dist/deleteMany.js +1 -2
- package/dist/index.js +1 -1
- package/dist/webpack.js +4 -2
- package/package.json +14 -16
- package/src/index.ts +89 -0
package/dist/createMigration.js
CHANGED
@@ -16,7 +16,7 @@ function _interop_require_default(obj) {
|
|
16
16
|
default: obj
|
17
17
|
};
|
18
18
|
}
|
19
|
-
const migrationTemplate = (upSQL, downSQL)=>`import { MigrateUpArgs, MigrateDownArgs } from '@payloadcms/db-postgres
|
19
|
+
const migrationTemplate = (upSQL, downSQL)=>`import { MigrateUpArgs, MigrateDownArgs } from '@payloadcms/db-postgres'
|
20
20
|
import { sql } from 'drizzle-orm'
|
21
21
|
|
22
22
|
export async function up({ payload }: MigrateUpArgs): Promise<void> {
|
@@ -82,4 +82,4 @@ const createMigration = async function createMigration(payload, migrationName) {
|
|
82
82
|
});
|
83
83
|
};
|
84
84
|
|
85
|
-
//# sourceMappingURL=data:application/json;base64,
|
85
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jcmVhdGVNaWdyYXRpb24udHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgbm8tcmVzdHJpY3RlZC1zeW50YXgsIG5vLWF3YWl0LWluLWxvb3AgKi9cbmltcG9ydCB0eXBlIHsgRHJpenpsZVNuYXBzaG90SlNPTiB9IGZyb20gJ2RyaXp6bGUta2l0L3V0aWxzJ1xuaW1wb3J0IHR5cGUgeyBDcmVhdGVNaWdyYXRpb24gfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuXG5pbXBvcnQgeyBnZW5lcmF0ZURyaXp6bGVKc29uLCBnZW5lcmF0ZU1pZ3JhdGlvbiB9IGZyb20gJ2RyaXp6bGUta2l0L3V0aWxzJ1xuaW1wb3J0IGZzIGZyb20gJ2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FrQixNQUFNQyxJQUFBQSx3QkFBaUIsRUFBQ2IsbUJBQW1CVTtJQUNuRSxNQUFNSSxvQkFBb0IsTUFBTUQsSUFBQUEsd0JBQWlCLEVBQUNILGtCQUFrQlY7SUFFcEVkLFdBQUUsQ0FBQzZCLGFBQWEsQ0FDZGhCLFVBQ0FsQyxrQkFDRStDLGdCQUFnQkksTUFBTSxHQUFHSixpQkFBaUJLLEtBQUssUUFBUUMsV0FDdkRKLGtCQUFrQkUsTUFBTSxHQUFHRixtQkFBbUJHLEtBQUssUUFBUUM7SUFHL0R4QyxRQUFRRSxNQUFNLENBQUNDLElBQUksQ0FBQztRQUFFQyxLQUFLLENBQUMscUJBQXFCLEVBQUVpQixTQUFTLENBQUM7SUFBQztBQUNoRSJ9
|
package/dist/deleteMany.js
CHANGED
@@ -38,7 +38,6 @@ const deleteMany = async function deleteMany({ collection, req = {}, where }) {
|
|
38
38
|
if (ids.length > 0) {
|
39
39
|
await db.delete(this.tables[tableName]).where((0, _drizzleorm.inArray)(this.tables[tableName].id, ids));
|
40
40
|
}
|
41
|
-
return result;
|
42
41
|
};
|
43
42
|
|
44
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9kZWxldGVNYW55LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgRGVsZXRlTWFueSB9IGZyb20gJ3BheWxvYWQvZGF0YWJhc2UnXG5pbXBvcnQgdHlwZSB7IFBheWxvYWRSZXF1ZXN0IH0gZnJvbSAncGF5bG9hZC90eXBlcydcblxuaW1wb3J0IHsgaW5BcnJheSB9IGZyb20gJ2RyaXp6bGUtb3JtJ1xuaW1wb3J0IHRvU25ha2VDYXNlIGZyb20gJ3RvLXNuYWtlLWNhc2UnXG5cbmltcG9ydCB0eXBlIHsgUG9zdGdyZXNBZGFwdGVyIH0gZnJvbSAnLi90eXBlcydcblxuaW1wb3J0IHsgZmluZE1hbnkgfS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UFZQyxJQUFBQSxvQkFBVyxFQUFDWDtJQUU5QixNQUFNWSxTQUFTLE1BQU1DLElBQUFBLGtCQUFRLEVBQUM7UUFDNUJDLFNBQVMsSUFBSTtRQUNiQyxRQUFRVCxpQkFBaUJTLE1BQU07UUFDL0JDLE9BQU87UUFDUEMsUUFBUWhCLElBQUlnQixNQUFNO1FBQ2xCQyxNQUFNO1FBQ05DLFlBQVk7UUFDWmxCO1FBQ0FTO1FBQ0FSO0lBQ0Y7SUFFQSxNQUFNa0IsTUFBTSxFQUFFO0lBRWRSLE9BQU9TLElBQUksQ0FBQ0MsT0FBTyxDQUFDLENBQUNDO1FBQ25CSCxJQUFJSSxJQUFJLENBQUNELEtBQUtFLEVBQUU7SUFDbEI7SUFFQSxJQUFJTCxJQUFJTSxNQUFNLEdBQUcsR0FBRztRQUNsQixNQUFNdkIsR0FBR3dCLE1BQU0sQ0FBQyxJQUFJLENBQUNDLE1BQU0sQ0FBQ2xCLFVBQVUsRUFBRVIsS0FBSyxDQUFDMkIsSUFBQUEsbUJBQU8sRUFBQyxJQUFJLENBQUNELE1BQU0sQ0FBQ2xCLFVBQVUsQ0FBQ2UsRUFBRSxFQUFFTDtJQUNuRjtBQUNGIn0=
|
package/dist/index.js
CHANGED
@@ -92,4 +92,4 @@ function postgresAdapter(args) {
|
|
92
92
|
return adapter;
|
93
93
|
}
|
94
94
|
|
95
|
-
//# sourceMappingURL=data:application/json;base64,
|
95
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IFBheWxvYWQgfSBmcm9tICdwYXlsb2FkJ1xuXG5pbXBvcnQgcGF0aCBmcm9tICdwYXRoJ1xuaW1wb3J0IHsgY3JlYXRlRGF0YWJhc2VBZGFwdGVyIH0gZnJvbSAncGF5bG9hZC9kYXRhYmFzZSdcblxuaW1wb3J0IHR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DUEMsTUFBQUEsVUFBSTtZQUNKQyxZQUFBQSxzQkFBVTtZQUNWQyxvQkFBQUEsc0NBQWtCO1lBQ2xCQyxTQUFBQSxnQkFBTztZQUNQQyxjQUFBQSwwQkFBWTtZQUNaQyxNQUFBQSxVQUFJO1lBQ0pDLFNBQUFBLGdCQUFPO1lBQ1BDLGVBQUFBLDRCQUFhO1lBQ2JsQztZQUNBRDtZQUNBb0MsYUFBQUEsd0JBQVc7WUFDWEMscUJBQUFBLHdDQUFtQjtZQUNuQkMsY0FBQUEsMEJBQVk7WUFDWkMscUJBQUFBLHdDQUFtQjtZQUNuQkMsV0FBQUEsaUJBQVM7WUFDVEMsZUFBQUEsNEJBQWE7WUFDYkMsU0FBQUEsZ0JBQU87UUFDVDtJQUNGO0lBRUEsT0FBTzNDO0FBQ1QifQ==
|
package/dist/webpack.js
CHANGED
@@ -15,16 +15,18 @@ function _interop_require_default(obj) {
|
|
15
15
|
};
|
16
16
|
}
|
17
17
|
const webpack = (config)=>{
|
18
|
+
const aliasPath = _path.default.resolve(__dirname, 'mock.js');
|
18
19
|
return {
|
19
20
|
...config,
|
20
21
|
resolve: {
|
21
22
|
...config.resolve || {},
|
22
23
|
alias: {
|
23
24
|
...config.resolve?.alias || {},
|
24
|
-
|
25
|
+
'@payloadcms/db-postgres': aliasPath,
|
26
|
+
[_path.default.resolve(__dirname, './index')]: aliasPath
|
25
27
|
}
|
26
28
|
}
|
27
29
|
};
|
28
30
|
};
|
29
31
|
|
30
|
-
//# sourceMappingURL=data:application/json;base64,
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy93ZWJwYWNrLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgV2VicGFjayB9IGZyb20gJ3BheWxvYWQvZGF0YWJhc2UnXG5cbmltcG9ydCBwYXRoIGZyb20gJ3BhdGgnXG5cbmV4cG9ydCBjb25zdCB3ZWJw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
|
"name": "@payloadcms/db-postgres",
|
3
|
-
"version": "0.1.0-beta.
|
3
|
+
"version": "0.1.0-beta.1",
|
4
4
|
"description": "The officially supported Postgres database adapter for Payload",
|
5
5
|
"repository": "https://github.com/payloadcms/payload",
|
6
6
|
"license": "MIT",
|
@@ -10,13 +10,8 @@
|
|
10
10
|
"name": "Payload",
|
11
11
|
"url": "https://payloadcms.com"
|
12
12
|
},
|
13
|
-
"main": "./
|
14
|
-
"types": "./
|
15
|
-
"scripts": {
|
16
|
-
"build": "pnpm build:swc && pnpm build:types",
|
17
|
-
"build:swc": "swc ./src -d ./dist --config-file .swcrc",
|
18
|
-
"build:types": "tsc --emitDeclarationOnly --outDir dist"
|
19
|
-
},
|
13
|
+
"main": "./dist/index.js",
|
14
|
+
"types": "./dist/index.d.ts",
|
20
15
|
"dependencies": {
|
21
16
|
"@libsql/client": "^0.3.1",
|
22
17
|
"console-table-printer": "2.11.2",
|
@@ -27,21 +22,24 @@
|
|
27
22
|
"to-snake-case": "1.0.0"
|
28
23
|
},
|
29
24
|
"devDependencies": {
|
30
|
-
"@payloadcms/eslint-config": "workspace:*",
|
31
25
|
"@types/pg": "8.10.2",
|
32
26
|
"@types/to-snake-case": "1.0.0",
|
33
|
-
"
|
34
|
-
"
|
27
|
+
"payload": "2.0.0-beta.2",
|
28
|
+
"@payloadcms/eslint-config": "0.0.1"
|
35
29
|
},
|
36
30
|
"peerDependencies": {
|
37
31
|
"better-sqlite3": "^8.5.0"
|
38
32
|
},
|
39
33
|
"publishConfig": {
|
40
|
-
"
|
41
|
-
"registry": "https://registry.npmjs.org/",
|
42
|
-
"types": "./dist/index.d.ts"
|
34
|
+
"registry": "https://registry.npmjs.org/"
|
43
35
|
},
|
44
36
|
"files": [
|
45
37
|
"dist"
|
46
|
-
]
|
47
|
-
|
38
|
+
],
|
39
|
+
"scripts": {
|
40
|
+
"build": "pnpm build:swc && pnpm build:types",
|
41
|
+
"build:swc": "swc ./src -d ./dist --config-file .swcrc",
|
42
|
+
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
43
|
+
"clean": "rimraf dist"
|
44
|
+
}
|
45
|
+
}
|
package/src/index.ts
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
import type { Payload } from 'payload'
|
2
|
+
|
3
|
+
import path from 'path'
|
4
|
+
import { createDatabaseAdapter } from 'payload/database'
|
5
|
+
|
6
|
+
import type { Args, PostgresAdapter, PostgresAdapterResult } from './types'
|
7
|
+
|
8
|
+
export type { MigrateDownArgs, MigrateUpArgs } from './types'
|
9
|
+
|
10
|
+
import { connect } from './connect'
|
11
|
+
import { create } from './create'
|
12
|
+
import { createGlobal } from './createGlobal'
|
13
|
+
import { createGlobalVersion } from './createGlobalVersion'
|
14
|
+
import { createMigration } from './createMigration'
|
15
|
+
import { createVersion } from './createVersion'
|
16
|
+
import { deleteMany } from './deleteMany'
|
17
|
+
import { deleteOne } from './deleteOne'
|
18
|
+
import { deleteVersions } from './deleteVersions'
|
19
|
+
import { destroy } from './destroy'
|
20
|
+
import { find } from './find'
|
21
|
+
import { findGlobal } from './findGlobal'
|
22
|
+
import { findGlobalVersions } from './findGlobalVersions'
|
23
|
+
import { findOne } from './findOne'
|
24
|
+
import { findVersions } from './findVersions'
|
25
|
+
import { init } from './init'
|
26
|
+
import { migrate } from './migrate'
|
27
|
+
import { migrateStatus } from './migrateStatus'
|
28
|
+
import { queryDrafts } from './queryDrafts'
|
29
|
+
import { beginTransaction } from './transactions/beginTransaction'
|
30
|
+
import { commitTransaction } from './transactions/commitTransaction'
|
31
|
+
import { rollbackTransaction } from './transactions/rollbackTransaction'
|
32
|
+
import { updateOne } from './update'
|
33
|
+
import { updateGlobal } from './updateGlobal'
|
34
|
+
import { updateGlobalVersion } from './updateGlobalVersion'
|
35
|
+
import { updateVersion } from './updateVersion'
|
36
|
+
import { webpack } from './webpack'
|
37
|
+
|
38
|
+
export function postgresAdapter(args: Args): PostgresAdapterResult {
|
39
|
+
function adapter({ payload }: { payload: Payload }) {
|
40
|
+
const migrationDir = args.migrationDir || path.resolve(__dirname, '../../../migrations')
|
41
|
+
return createDatabaseAdapter<PostgresAdapter>({
|
42
|
+
...args,
|
43
|
+
name: 'postgres',
|
44
|
+
|
45
|
+
// Postgres-specific
|
46
|
+
db: undefined,
|
47
|
+
enums: {},
|
48
|
+
pool: undefined,
|
49
|
+
relations: {},
|
50
|
+
schema: {},
|
51
|
+
sessions: {},
|
52
|
+
tables: {},
|
53
|
+
|
54
|
+
// DatabaseAdapter
|
55
|
+
beginTransaction,
|
56
|
+
commitTransaction,
|
57
|
+
connect,
|
58
|
+
create,
|
59
|
+
createGlobal,
|
60
|
+
createGlobalVersion,
|
61
|
+
createMigration,
|
62
|
+
createVersion,
|
63
|
+
defaultIDType: 'number',
|
64
|
+
deleteMany,
|
65
|
+
deleteOne,
|
66
|
+
deleteVersions,
|
67
|
+
destroy,
|
68
|
+
find,
|
69
|
+
findGlobal,
|
70
|
+
findGlobalVersions,
|
71
|
+
findOne,
|
72
|
+
findVersions,
|
73
|
+
init,
|
74
|
+
migrate,
|
75
|
+
migrateStatus,
|
76
|
+
migrationDir,
|
77
|
+
payload,
|
78
|
+
queryDrafts,
|
79
|
+
rollbackTransaction,
|
80
|
+
updateGlobal,
|
81
|
+
updateGlobalVersion,
|
82
|
+
updateOne,
|
83
|
+
updateVersion,
|
84
|
+
webpack,
|
85
|
+
})
|
86
|
+
}
|
87
|
+
|
88
|
+
return adapter
|
89
|
+
}
|