@payloadcms/db-postgres 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"commitTransaction.d.ts","sourceRoot":"","sources":["../../src/transactions/commitTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEzD,eAAO,MAAM,iBAAiB,EAAE,
|
1
|
+
{"version":3,"file":"commitTransaction.d.ts","sourceRoot":"","sources":["../../src/transactions/commitTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEzD,eAAO,MAAM,iBAAiB,EAAE,iBAY/B,CAAA"}
|
@@ -10,7 +10,6 @@ Object.defineProperty(exports, "commitTransaction", {
|
|
10
10
|
});
|
11
11
|
const commitTransaction = async function commitTransaction(id) {
|
12
12
|
if (!this.sessions[id]) {
|
13
|
-
this.payload.logger.warn('commitTransaction called when no transaction exists');
|
14
13
|
return;
|
15
14
|
}
|
16
15
|
try {
|
@@ -21,4 +20,4 @@ const commitTransaction = async function commitTransaction(id) {
|
|
21
20
|
delete this.sessions[id];
|
22
21
|
};
|
23
22
|
|
24
|
-
//# sourceMappingURL=data:application/json;base64,
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90cmFuc2FjdGlvbnMvY29tbWl0VHJhbnNhY3Rpb24udHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBDb21taXRUcmFuc2FjdGlvbiB9IGZyb20gJ3BheWxvYWQvZGF0YWJhc2UnXG5cbmV4cG9ydCBjb25zdCBjb21taXRUcmFuc2FjdGlvbjogQ29tbWl0VHJhbnNhY3Rpb24gPSBhc3luYyBmdW5jdGlvbiBjb21taXRUcmFuc2FjdGlvbihpZCkge1xuICBpZiAoIXRoaXMuc2Vzc2lvbnNbaWRdKSB7XG4gICAgcmV0dXJuXG4gIH1cblxuICB0cnkge1xuICAgIHRoaXMuc2Vzc2lvbnNbaWRdLnJlc29sdmUoKVxuICB9IGNhdGNoIChlcnI6IHVua25vd24pIHtcbiAgICB0aGlzLnNlc3Npb25zW2lkXS5yZWplY3QoKVxuICB9XG5cbiAgZGVsZXRlIHRoaXMuc2Vzc2lvbnNbaWRdXG59XG4iXSwibmFtZXMiOlsiY29tbWl0VHJhbnNhY3Rpb24iLCJpZCIsInNlc3Npb25zIiwicmVzb2x2ZSIsImVyciIsInJlamVjdCJdLCJtYXBwaW5ncyI6Ijs7OzsrQkFFYUE7OztlQUFBQTs7O0FBQU4sTUFBTUEsb0JBQXVDLGVBQWVBLGtCQUFrQkMsRUFBRTtJQUNyRixJQUFJLENBQUMsSUFBSSxDQUFDQyxRQUFRLENBQUNELEdBQUcsRUFBRTtRQUN0QjtJQUNGO0lBRUEsSUFBSTtRQUNGLElBQUksQ0FBQ0MsUUFBUSxDQUFDRCxHQUFHLENBQUNFLE9BQU87SUFDM0IsRUFBRSxPQUFPQyxLQUFjO1FBQ3JCLElBQUksQ0FBQ0YsUUFBUSxDQUFDRCxHQUFHLENBQUNJLE1BQU07SUFDMUI7SUFFQSxPQUFPLElBQUksQ0FBQ0gsUUFBUSxDQUFDRCxHQUFHO0FBQzFCIn0=
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@payloadcms/db-postgres",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.1",
|
4
4
|
"description": "The officially supported Postgres database adapter for Payload",
|
5
5
|
"repository": "https://github.com/payloadcms/payload",
|
6
6
|
"license": "MIT",
|
@@ -25,7 +25,7 @@
|
|
25
25
|
"@types/pg": "8.10.2",
|
26
26
|
"@types/to-snake-case": "1.0.0",
|
27
27
|
"@payloadcms/eslint-config": "0.0.1",
|
28
|
-
"payload": "2.0.
|
28
|
+
"payload": "2.0.2"
|
29
29
|
},
|
30
30
|
"peerDependencies": {
|
31
31
|
"better-sqlite3": "^8.5.0"
|
package/src/index.ts
DELETED
@@ -1,102 +0,0 @@
|
|
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
|
-
import { connect } from './connect'
|
9
|
-
import { create } from './create'
|
10
|
-
import { createGlobal } from './createGlobal'
|
11
|
-
import { createGlobalVersion } from './createGlobalVersion'
|
12
|
-
import { createMigration } from './createMigration'
|
13
|
-
import { createVersion } from './createVersion'
|
14
|
-
import { deleteMany } from './deleteMany'
|
15
|
-
import { deleteOne } from './deleteOne'
|
16
|
-
import { deleteVersions } from './deleteVersions'
|
17
|
-
import { destroy } from './destroy'
|
18
|
-
import { extendViteConfig } from './extendViteConfig'
|
19
|
-
import { extendWebpackConfig } from './extendWebpackConfig'
|
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 { migrateDown } from './migrateDown'
|
28
|
-
import { migrateFresh } from './migrateFresh'
|
29
|
-
import { migrateRefresh } from './migrateRefresh'
|
30
|
-
import { migrateReset } from './migrateReset'
|
31
|
-
import { migrateStatus } from './migrateStatus'
|
32
|
-
import { queryDrafts } from './queryDrafts'
|
33
|
-
import { beginTransaction } from './transactions/beginTransaction'
|
34
|
-
import { commitTransaction } from './transactions/commitTransaction'
|
35
|
-
import { rollbackTransaction } from './transactions/rollbackTransaction'
|
36
|
-
import { updateOne } from './update'
|
37
|
-
import { updateGlobal } from './updateGlobal'
|
38
|
-
import { updateGlobalVersion } from './updateGlobalVersion'
|
39
|
-
import { updateVersion } from './updateVersion'
|
40
|
-
|
41
|
-
export type { MigrateDownArgs, MigrateUpArgs } from './types'
|
42
|
-
|
43
|
-
export function postgresAdapter(args: Args): PostgresAdapterResult {
|
44
|
-
function adapter({ payload }: { payload: Payload }) {
|
45
|
-
const migrationDir = args.migrationDir || path.resolve(process.cwd(), 'src/migrations')
|
46
|
-
|
47
|
-
extendWebpackConfig(payload.config)
|
48
|
-
extendViteConfig(payload.config)
|
49
|
-
|
50
|
-
return createDatabaseAdapter<PostgresAdapter>({
|
51
|
-
name: 'postgres',
|
52
|
-
|
53
|
-
// Postgres-specific
|
54
|
-
drizzle: undefined,
|
55
|
-
enums: {},
|
56
|
-
pool: undefined,
|
57
|
-
poolOptions: args.pool,
|
58
|
-
push: args.push,
|
59
|
-
relations: {},
|
60
|
-
schema: {},
|
61
|
-
sessions: {},
|
62
|
-
tables: {},
|
63
|
-
|
64
|
-
// DatabaseAdapter
|
65
|
-
beginTransaction,
|
66
|
-
commitTransaction,
|
67
|
-
connect,
|
68
|
-
create,
|
69
|
-
createGlobal,
|
70
|
-
createGlobalVersion,
|
71
|
-
createMigration,
|
72
|
-
createVersion,
|
73
|
-
defaultIDType: 'number',
|
74
|
-
deleteMany,
|
75
|
-
deleteOne,
|
76
|
-
deleteVersions,
|
77
|
-
destroy,
|
78
|
-
find,
|
79
|
-
findGlobal,
|
80
|
-
findGlobalVersions,
|
81
|
-
findOne,
|
82
|
-
findVersions,
|
83
|
-
init,
|
84
|
-
migrate,
|
85
|
-
migrateDown,
|
86
|
-
migrateFresh,
|
87
|
-
migrateRefresh,
|
88
|
-
migrateReset,
|
89
|
-
migrateStatus,
|
90
|
-
migrationDir,
|
91
|
-
payload,
|
92
|
-
queryDrafts,
|
93
|
-
rollbackTransaction,
|
94
|
-
updateGlobal,
|
95
|
-
updateGlobalVersion,
|
96
|
-
updateOne,
|
97
|
-
updateVersion,
|
98
|
-
})
|
99
|
-
}
|
100
|
-
|
101
|
-
return adapter
|
102
|
-
}
|