@payloadcms/db-postgres 0.1.0-beta.0 → 0.1.0-beta.10
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/connect.d.ts +3 -0
- package/dist/connect.d.ts.map +1 -0
- package/dist/connect.js +12 -12
- package/dist/create.d.ts +3 -0
- package/dist/create.d.ts.map +1 -0
- package/dist/create.js +2 -2
- package/dist/createGlobal.d.ts +5 -0
- package/dist/createGlobal.d.ts.map +1 -0
- package/dist/createGlobal.js +2 -2
- package/dist/createGlobalVersion.d.ts +6 -0
- package/dist/createGlobalVersion.d.ts.map +1 -0
- package/dist/createGlobalVersion.js +2 -2
- package/dist/createMigration.d.ts +3 -0
- package/dist/createMigration.d.ts.map +1 -0
- package/dist/createMigration.js +6 -6
- package/dist/createVersion.d.ts +5 -0
- package/dist/createVersion.d.ts.map +1 -0
- package/dist/createVersion.js +2 -2
- package/dist/deleteMany.d.ts +3 -0
- package/dist/deleteMany.d.ts.map +1 -0
- package/dist/deleteMany.js +2 -3
- package/dist/deleteOne.d.ts +3 -0
- package/dist/deleteOne.d.ts.map +1 -0
- package/dist/deleteOne.js +2 -2
- package/dist/deleteVersions.d.ts +3 -0
- package/dist/deleteVersions.d.ts.map +1 -0
- package/dist/deleteVersions.js +2 -2
- package/dist/destroy.d.ts +3 -0
- package/dist/destroy.d.ts.map +1 -0
- 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.d.ts +13 -0
- package/dist/find/buildFindManyArgs.d.ts.map +1 -0
- package/dist/find/chainMethods.d.ts +15 -0
- package/dist/find/chainMethods.d.ts.map +1 -0
- package/dist/find/findMany.d.ts +22 -0
- package/dist/find/findMany.d.ts.map +1 -0
- package/dist/find/findMany.js +2 -2
- package/dist/find/traverseFields.d.ts +16 -0
- package/dist/find/traverseFields.d.ts.map +1 -0
- package/dist/find.d.ts +3 -0
- package/dist/find.d.ts.map +1 -0
- package/dist/findGlobal.d.ts +3 -0
- package/dist/findGlobal.d.ts.map +1 -0
- package/dist/findGlobalVersions.d.ts +3 -0
- package/dist/findGlobalVersions.d.ts.map +1 -0
- package/dist/findOne.d.ts +5 -0
- package/dist/findOne.d.ts.map +1 -0
- package/dist/findOne.js +2 -2
- package/dist/findVersions.d.ts +3 -0
- package/dist/findVersions.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -6
- package/dist/init.d.ts +3 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +3 -4
- package/dist/migrate.d.ts +3 -0
- package/dist/migrate.d.ts.map +1 -0
- package/dist/migrate.js +4 -5
- package/dist/migrateStatus.d.ts +3 -0
- package/dist/migrateStatus.d.ts.map +1 -0
- package/dist/migrateStatus.js +2 -2
- package/dist/queries/buildAndOrConditions.d.ts +17 -0
- package/dist/queries/buildAndOrConditions.d.ts.map +1 -0
- package/dist/queries/buildQuery.d.ts +30 -0
- package/dist/queries/buildQuery.d.ts.map +1 -0
- package/dist/queries/createJSONQuery/convertPathToJSONTraversal.d.ts +2 -0
- package/dist/queries/createJSONQuery/convertPathToJSONTraversal.d.ts.map +1 -0
- package/dist/queries/createJSONQuery/formatJSONPathSegment.d.ts +2 -0
- package/dist/queries/createJSONQuery/formatJSONPathSegment.d.ts.map +1 -0
- package/dist/queries/createJSONQuery/index.d.ts +10 -0
- package/dist/queries/createJSONQuery/index.d.ts.map +1 -0
- package/dist/queries/getTableColumnFromPath.d.ts +40 -0
- package/dist/queries/getTableColumnFromPath.d.ts.map +1 -0
- package/dist/queries/operatorMap.d.ts +18 -0
- package/dist/queries/operatorMap.d.ts.map +1 -0
- package/dist/queries/parseParams.d.ts +17 -0
- package/dist/queries/parseParams.d.ts.map +1 -0
- package/dist/queries/parseParams.js +1 -1
- package/dist/queries/sanitizeQueryValue.d.ts +12 -0
- package/dist/queries/sanitizeQueryValue.d.ts.map +1 -0
- package/dist/queryDrafts.d.ts +3 -0
- package/dist/queryDrafts.d.ts.map +1 -0
- package/dist/reference.d.ts +2 -0
- package/dist/reference.d.ts.map +1 -0
- package/dist/schema/build.d.ts +23 -0
- package/dist/schema/build.d.ts.map +1 -0
- package/dist/schema/build.js +6 -5
- package/dist/schema/createIndex.d.ts +11 -0
- package/dist/schema/createIndex.d.ts.map +1 -0
- package/dist/schema/createIndex.js +12 -3
- package/dist/schema/parentIDColumnMap.d.ts +7 -0
- package/dist/schema/parentIDColumnMap.d.ts.map +1 -0
- package/dist/schema/traverseFields.d.ts +33 -0
- package/dist/schema/traverseFields.d.ts.map +1 -0
- package/dist/schema/traverseFields.js +25 -9
- package/dist/schema/validateExistingBlockIsIdentical.d.ts +11 -0
- package/dist/schema/validateExistingBlockIsIdentical.d.ts.map +1 -0
- package/dist/transactions/beginTransaction.d.ts +3 -0
- package/dist/transactions/beginTransaction.d.ts.map +1 -0
- package/dist/transactions/beginTransaction.js +2 -2
- package/dist/transactions/commitTransaction.d.ts +3 -0
- package/dist/transactions/commitTransaction.d.ts.map +1 -0
- package/dist/transactions/rollbackTransaction.d.ts +3 -0
- package/dist/transactions/rollbackTransaction.d.ts.map +1 -0
- package/dist/transform/read/hasManyNumber.d.ts +10 -0
- package/dist/transform/read/hasManyNumber.d.ts.map +1 -0
- package/dist/transform/read/index.d.ts +12 -0
- package/dist/transform/read/index.d.ts.map +1 -0
- package/dist/transform/read/relationship.d.ts +10 -0
- package/dist/transform/read/relationship.d.ts.map +1 -0
- package/dist/transform/read/traverseFields.d.ts +44 -0
- package/dist/transform/read/traverseFields.d.ts.map +1 -0
- package/dist/transform/write/array.d.ts +22 -0
- package/dist/transform/write/array.d.ts.map +1 -0
- package/dist/transform/write/blocks.d.ts +21 -0
- package/dist/transform/write/blocks.d.ts.map +1 -0
- package/dist/transform/write/index.d.ts +11 -0
- package/dist/transform/write/index.d.ts.map +1 -0
- package/dist/transform/write/numbers.d.ts +8 -0
- package/dist/transform/write/numbers.d.ts.map +1 -0
- package/dist/transform/write/relationships.d.ts +10 -0
- package/dist/transform/write/relationships.d.ts.map +1 -0
- package/dist/transform/write/selects.d.ts +7 -0
- package/dist/transform/write/selects.d.ts.map +1 -0
- package/dist/transform/write/traverseFields.d.ts +46 -0
- package/dist/transform/write/traverseFields.d.ts.map +1 -0
- package/dist/transform/write/types.d.ts +41 -0
- package/dist/transform/write/types.d.ts.map +1 -0
- package/dist/types.d.ts +67 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/update.d.ts +3 -0
- package/dist/update.d.ts.map +1 -0
- package/dist/update.js +2 -2
- package/dist/updateGlobal.d.ts +5 -0
- package/dist/updateGlobal.d.ts.map +1 -0
- package/dist/updateGlobal.js +2 -2
- package/dist/updateGlobalVersion.d.ts +6 -0
- package/dist/updateGlobalVersion.d.ts.map +1 -0
- package/dist/updateGlobalVersion.js +2 -2
- package/dist/updateVersion.d.ts +5 -0
- package/dist/updateVersion.d.ts.map +1 -0
- package/dist/updateVersion.js +2 -2
- package/dist/upsertRow/deleteExistingArrayRows.d.ts +10 -0
- package/dist/upsertRow/deleteExistingArrayRows.d.ts.map +1 -0
- package/dist/upsertRow/deleteExistingRowsByPath.d.ts +14 -0
- package/dist/upsertRow/deleteExistingRowsByPath.d.ts.map +1 -0
- package/dist/upsertRow/index.d.ts +4 -0
- package/dist/upsertRow/index.d.ts.map +1 -0
- package/dist/upsertRow/insertArrays.d.ts +13 -0
- package/dist/upsertRow/insertArrays.d.ts.map +1 -0
- package/dist/upsertRow/types.d.ts +26 -0
- package/dist/upsertRow/types.d.ts.map +1 -0
- package/dist/utilities/appendPrefixToKeys.d.ts +2 -0
- package/dist/utilities/appendPrefixToKeys.d.ts.map +1 -0
- package/dist/utilities/createBlocksMap.d.ts +5 -0
- package/dist/utilities/createBlocksMap.d.ts.map +1 -0
- package/dist/utilities/createMigrationTable.d.ts +3 -0
- package/dist/utilities/createMigrationTable.d.ts.map +1 -0
- package/dist/utilities/createRelationshipMap.d.ts +2 -0
- package/dist/utilities/createRelationshipMap.d.ts.map +1 -0
- package/dist/utilities/hasLocalesTable.d.ts +3 -0
- package/dist/utilities/hasLocalesTable.d.ts.map +1 -0
- package/dist/utilities/isArrayOfRows.d.ts +2 -0
- package/dist/utilities/isArrayOfRows.d.ts.map +1 -0
- package/dist/utilities/migrationTableExists.d.ts +3 -0
- package/dist/utilities/migrationTableExists.d.ts.map +1 -0
- package/mock.js +1 -0
- package/package.json +16 -17
- package/src/index.ts +93 -0
- package/dist/mock.js +0 -13
- package/dist/webpack.js +0 -30
@@ -0,0 +1,22 @@
|
|
1
|
+
import type { FindArgs } from 'payload/database';
|
2
|
+
import type { Field } from 'payload/types';
|
3
|
+
import type { PostgresAdapter } from '../types';
|
4
|
+
type Args = Omit<FindArgs, 'collection'> & {
|
5
|
+
adapter: PostgresAdapter;
|
6
|
+
fields: Field[];
|
7
|
+
tableName: string;
|
8
|
+
};
|
9
|
+
export declare const findMany: ({ adapter, fields, limit: limitArg, locale, page, pagination, req, skip, sort, tableName, where: whereArg, }: Args) => Promise<{
|
10
|
+
docs: any;
|
11
|
+
hasNextPage: boolean;
|
12
|
+
hasPrevPage: boolean;
|
13
|
+
limit: number;
|
14
|
+
nextPage: number;
|
15
|
+
page: number;
|
16
|
+
pagingCounter: number;
|
17
|
+
prevPage: number;
|
18
|
+
totalDocs: number;
|
19
|
+
totalPages: number;
|
20
|
+
}>;
|
21
|
+
export {};
|
22
|
+
//# sourceMappingURL=findMany.d.ts.map
|
@@ -0,0 +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;AAQ/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;;;;;;;;;;;EAuKN,CAAA"}
|
package/dist/find/findMany.js
CHANGED
@@ -19,7 +19,7 @@ function _interop_require_default(obj) {
|
|
19
19
|
};
|
20
20
|
}
|
21
21
|
const findMany = async function find({ adapter, fields, limit: limitArg, locale, page = 1, pagination, req = {}, skip, sort, tableName, where: whereArg }) {
|
22
|
-
const db = adapter.sessions[req.transactionID]?.db || adapter.
|
22
|
+
const db = adapter.sessions[req.transactionID]?.db || adapter.drizzle;
|
23
23
|
const table = adapter.tables[tableName];
|
24
24
|
let limit = limitArg;
|
25
25
|
let totalDocs;
|
@@ -194,4 +194,4 @@ const findMany = async function find({ adapter, fields, limit: limitArg, locale,
|
|
194
194
|
};
|
195
195
|
};
|
196
196
|
|
197
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maW5kL2ZpbmRNYW55LnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgRmluZEFyZ3MgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuaW1wb3J0IHR5cGUgeyBGaWVsZCwgUGF5bG9hZFJlcXVlc3QsIFR5cGVXaXRoSUQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgeyBpbkFycmF5LCBzcWwgfSBmcm9tICdkcml6emxlLW9ybSdcblxuaW1wb3J0IHR5cGUgeyBQb3N0Z3Jlc0FkYXB0ZXIgfSBmcm9tICcuLi90eXBlcydcbmltcG9ydCB0eXBlIHsgQ2hhaW5lZE1ldGhvZHMgfSBmcm9tICcuL2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yxFQUFFZCxFQUFFLENBQUMsR0FBRzFCLFlBQVksQ0FBQ3lDLEVBQUVmLEVBQUUsQ0FBQztJQUNoRTtJQUVBLElBQUlsRCxlQUFlLE9BQU87UUFDeEJhLFlBQVlrRCxRQUFRM0IsTUFBTTtRQUMxQnhDLFFBQVFpQjtRQUNSQyxhQUFhO1FBQ2JHLGdCQUFnQjtRQUNoQkYsY0FBYztRQUNkQyxjQUFjO0lBQ2hCO0lBRUEsTUFBTStCLE9BQU9nQixRQUFRRyxHQUFHLENBQUMsQ0FBQ0M7UUFDeEIsT0FBT0MsSUFBQUEsZUFBUyxFQUFDO1lBQ2ZDLFFBQVEzRSxRQUFRNEUsT0FBTyxDQUFDRCxNQUFNO1lBQzlCRjtZQUNBeEU7UUFDRjtJQUNGO0lBRUEsT0FBTztRQUNMb0Q7UUFDQS9CO1FBQ0FEO1FBQ0FuQjtRQUNBb0QsVUFBVWhDLGNBQWNqQixPQUFPLElBQUk7UUFDbkNBO1FBQ0FrQjtRQUNBZ0MsVUFBVWxDLGNBQWNoQixPQUFPLElBQUk7UUFDbkNjO1FBQ0FDO0lBQ0Y7QUFDRiJ9
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import type { Field } from 'payload/types';
|
2
|
+
import type { PostgresAdapter } from '../types';
|
3
|
+
type TraverseFieldArgs = {
|
4
|
+
_locales: Record<string, unknown>;
|
5
|
+
adapter: PostgresAdapter;
|
6
|
+
currentArgs: Record<string, unknown>;
|
7
|
+
currentTableName: string;
|
8
|
+
depth?: number;
|
9
|
+
fields: Field[];
|
10
|
+
path: string;
|
11
|
+
topLevelArgs: Record<string, unknown>;
|
12
|
+
topLevelTableName: string;
|
13
|
+
};
|
14
|
+
export declare const traverseFields: ({ _locales, adapter, currentArgs, currentTableName, depth, fields, path, topLevelArgs, topLevelTableName, }: TraverseFieldArgs) => Record<string, unknown>;
|
15
|
+
export {};
|
16
|
+
//# sourceMappingURL=traverseFields.d.ts.map
|
@@ -0,0 +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,gHAUxB,iBAAiB,4BA0GnB,CAAA"}
|
package/dist/find.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../src/find.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAS5C,eAAO,MAAM,IAAI,EAAE,IA4BlB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"findGlobal.d.ts","sourceRoot":"","sources":["../src/findGlobal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAQlD,eAAO,MAAM,UAAU,EAAE,UA0BxB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"findGlobalVersions.d.ts","sourceRoot":"","sources":["../src/findGlobalVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAU1D,eAAO,MAAM,kBAAkB,EAAE,kBAmChC,CAAA"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { FindOneArgs } from 'payload/database';
|
2
|
+
import type { TypeWithID } from 'payload/types';
|
3
|
+
import type { PostgresAdapter } from './types';
|
4
|
+
export declare function findOne<T extends TypeWithID>(this: PostgresAdapter, { collection, locale, req, where: incomingWhere }: FindOneArgs): Promise<T>;
|
5
|
+
//# sourceMappingURL=findOne.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"findOne.d.ts","sourceRoot":"","sources":["../src/findOne.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAA6C,UAAU,EAAE,MAAM,eAAe,CAAA;AAI1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAM9C,wBAAsB,OAAO,CAAC,CAAC,SAAS,UAAU,EAChD,IAAI,EAAE,eAAe,EACrB,EAAE,UAAU,EAAE,MAAM,EAAE,GAA0B,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,WAAW,GACpF,OAAO,CAAC,CAAC,CAAC,CAiCZ"}
|
package/dist/findOne.js
CHANGED
@@ -18,7 +18,7 @@ function _interop_require_default(obj) {
|
|
18
18
|
};
|
19
19
|
}
|
20
20
|
async function findOne({ collection, locale, req = {}, where: incomingWhere }) {
|
21
|
-
const db = this.sessions[req.transactionID]?.db || this.
|
21
|
+
const db = this.sessions[req.transactionID]?.db || this.drizzle;
|
22
22
|
const collectionConfig = this.payload.collections[collection].config;
|
23
23
|
const tableName = (0, _tosnakecase.default)(collection);
|
24
24
|
const { where } = await (0, _buildQuery.default)({
|
@@ -46,4 +46,4 @@ async function findOne({ collection, locale, req = {}, where: incomingWhere }) {
|
|
46
46
|
});
|
47
47
|
}
|
48
48
|
|
49
|
-
//# sourceMappingURL=data:application/json;base64,
|
49
|
+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EQsSUFBSSxDQUFDRyxLQUFLO1FBQ1IsT0FBTztJQUNUO0lBRUEsT0FBT0csSUFBQUEsZUFBUyxFQUFJO1FBQ2xCWixRQUFRLElBQUksQ0FBQ0YsT0FBTyxDQUFDRSxNQUFNO1FBQzNCYSxNQUFNSjtRQUNOSixRQUFRUixpQkFBaUJRLE1BQU07SUFDakM7QUFDRiJ9
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"findVersions.d.ts","sourceRoot":"","sources":["../src/findVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAUpD,eAAO,MAAM,YAAY,EAAE,YAiC1B,CAAA"}
|
package/dist/index.d.ts
ADDED
@@ -0,0 +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;AAE3E,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AA+B7D,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,qBAAqB,CAsDjE"}
|
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");
|
@@ -36,7 +38,6 @@ const _update = require("./update");
|
|
36
38
|
const _updateGlobal = require("./updateGlobal");
|
37
39
|
const _updateGlobalVersion = require("./updateGlobalVersion");
|
38
40
|
const _updateVersion = require("./updateVersion");
|
39
|
-
const _webpack = require("./webpack");
|
40
41
|
function _interop_require_default(obj) {
|
41
42
|
return obj && obj.__esModule ? obj : {
|
42
43
|
default: obj
|
@@ -44,12 +45,14 @@ function _interop_require_default(obj) {
|
|
44
45
|
}
|
45
46
|
function postgresAdapter(args) {
|
46
47
|
function adapter({ payload }) {
|
47
|
-
const migrationDir = args.migrationDir || _path.default.resolve(
|
48
|
+
const migrationDir = args.migrationDir || _path.default.resolve(process.cwd(), 'src/migrations');
|
49
|
+
(0, _extendWebpackConfig.extendWebpackConfig)(payload.config);
|
50
|
+
(0, _extendViteConfig.extendViteConfig)(payload.config);
|
48
51
|
return (0, _database.createDatabaseAdapter)({
|
49
52
|
...args,
|
50
53
|
name: 'postgres',
|
51
54
|
// Postgres-specific
|
52
|
-
|
55
|
+
drizzle: undefined,
|
53
56
|
enums: {},
|
54
57
|
pool: undefined,
|
55
58
|
relations: {},
|
@@ -85,11 +88,10 @@ function postgresAdapter(args) {
|
|
85
88
|
updateGlobal: _updateGlobal.updateGlobal,
|
86
89
|
updateGlobalVersion: _updateGlobalVersion.updateGlobalVersion,
|
87
90
|
updateOne: _update.updateOne,
|
88
|
-
updateVersion: _updateVersion.updateVersion
|
89
|
-
webpack: _webpack.webpack
|
91
|
+
updateVersion: _updateVersion.updateVersion
|
90
92
|
});
|
91
93
|
}
|
92
94
|
return adapter;
|
93
95
|
}
|
94
96
|
|
95
|
-
//# sourceMappingURL=data:application/json;base64,
|
97
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IFBheWxvYWQgfSBmcm9tICdwYXlsb2FkJ1xuXG5pbXBvcnQgcGF0aCBmcm9tICdwYXRoJ1xuaW1wb3J0IHsgY3JlYXRlRGF0YWJhc2VBZGFwdGVyIH0gZnJvbSAncGF5bG9hZC9kYXRhYmFzZSdcblxuaW1wb3J0IHR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j) {
|
|
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);
|
28
26
|
(0, _build.buildTable)({
|
29
27
|
adapter: this,
|
30
28
|
buildRelationships: true,
|
29
|
+
collectionIndexes: collection.indexes,
|
31
30
|
disableUnique: false,
|
32
31
|
fields: collection.fields,
|
33
32
|
tableName,
|
@@ -71,4 +70,4 @@ const init = async function init() {
|
|
71
70
|
});
|
72
71
|
};
|
73
72
|
|
74
|
-
//# sourceMappingURL=data:application/json;base64,
|
73
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbml0LnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLXBhcmFtLXJlYXNzaWduICovXG5pbXBvcnQgdHlwZSB7IEluaXQgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuaW1wb3J0IHR5cGUgeyBTYW5pdGl6ZWRDb2xsZWN0aW9uQ29uZmlnIH0gZnJvbSAncGF5bG9hZC90eXBlcydcblxuaW1wb3J0IHsgcGdFbnVtIH0gZnJvbSAnZHJpenpsZS1vcm0vcGctY29yZSdcbmltcG9ydCB7IGJ1aWxkVmVyc2lvbkNvbGxlY3Rpb25GaWVsZHMsIGJ1aWxkVmVyc2lvbkdsb2JhbEZpZWxkcyB9IGZyb20gJ3BheWxvYWQvdmVyc2lvbnMnXG5pbXBvcnQgdG9TbmFrZUNhc2UgZnJvbSAndG8tc25ha2Ut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0MsSUFBQUEsaUJBQVUsRUFBQztZQUNUQyxTQUFTLElBQUk7WUFDYkMsb0JBQW9CO1lBQ3BCRyxlQUFlO1lBQ2ZDLFFBQVFPLE9BQU9QLE1BQU07WUFDckJUO1lBQ0FVLFlBQVk7UUFDZDtRQUVBLElBQUlNLE9BQU9MLFFBQVEsRUFBRTtZQUNuQixNQUFNQyxvQkFBb0IsQ0FBQyxDQUFDLEVBQUVaLFVBQVUsRUFBRSxDQUFDO1lBQzNDLE1BQU1hLGdCQUFnQkksSUFBQUEsa0NBQXdCLEVBQUNEO1lBRS9DYixJQUFBQSxpQkFBVSxFQUFDO2dCQUNUQyxTQUFTLElBQUk7Z0JBQ2JDLG9CQUFvQjtnQkFDcEJHLGVBQWU7Z0JBQ2ZDLFFBQVFJO2dCQUNSYixXQUFXWTtnQkFDWEYsWUFBWTtZQUNkO1FBQ0Y7SUFDRjtBQUNGIn0=
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../src/migrate.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAK9C,wBAAsB,OAAO,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAiElE"}
|
package/dist/migrate.js
CHANGED
@@ -20,7 +20,7 @@ async function migrate() {
|
|
20
20
|
});
|
21
21
|
let latestBatch = 0;
|
22
22
|
let existingMigrations = [];
|
23
|
-
const hasMigrationTable = await (0, _migrationTableExists.migrationTableExists)(this.
|
23
|
+
const hasMigrationTable = await (0, _migrationTableExists.migrationTableExists)(this.drizzle);
|
24
24
|
if (hasMigrationTable) {
|
25
25
|
({ docs: existingMigrations } = await payload.find({
|
26
26
|
collection: 'payload-migrations',
|
@@ -31,7 +31,7 @@ async function migrate() {
|
|
31
31
|
latestBatch = Number(existingMigrations[0]?.batch);
|
32
32
|
}
|
33
33
|
} else {
|
34
|
-
await (0, _createMigrationTable.createMigrationTable)(this.
|
34
|
+
await (0, _createMigrationTable.createMigrationTable)(this.drizzle);
|
35
35
|
}
|
36
36
|
const newBatch = latestBatch + 1;
|
37
37
|
// Execute 'up' function for each migration sequentially
|
@@ -45,8 +45,7 @@ async function migrate() {
|
|
45
45
|
payload.logger.info({
|
46
46
|
msg: `Migrating: ${migration.name}`
|
47
47
|
});
|
48
|
-
const pgAdapter = payload.db
|
49
|
-
;
|
48
|
+
const pgAdapter = payload.db;
|
50
49
|
const drizzleJSON = (0, _utils.generateDrizzleJson)(pgAdapter.schema);
|
51
50
|
try {
|
52
51
|
await migration.up({
|
@@ -78,4 +77,4 @@ async function migrate() {
|
|
78
77
|
}
|
79
78
|
}
|
80
79
|
|
81
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9taWdyYXRlLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLXJlc3RyaWN0ZWQtc3ludGF4LCBuby1hd2FpdC1pbi1sb29wICovXG5pbXBvcnQgeyBnZW5lcmF0ZURyaXp6bGVKc29uIH0gZnJvbSAnZHJpenpsZS1raXQvdXRpbHMnXG5pbXBvcnQgeyByZWFkTWlncmF0aW9uRmlsZXMgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuaW1wb3J0IHsgRGF0YWJhc2VFcnJvciB9IGZyb20gJ3BnJ1xuXG5pbXBvcnQgdHlwZSB7IFBvc3RncmVzQWRhcHRlciB9IGZyb20gJy4vdHlwZXMnXG5cbmltcG9ydCB7IGNyZWF0ZU1pZ3JhdGlvblRhYmxlIH0gZnJvbSAnLi91dGlsaXRpZXMvY3JlYXRlTWlncmF0aW9uVGFibGUnXG5pbXBvcnQgeyBtaWdyYXRpb25UYWJsZUV4aXN0cyB9IGZyb20gJy4vdXRpbGl0aWVzL21pZ3JhdGlvblRhYmxlRXhpc3RzJ1xuXG5leHBvcnQgYXN5bmMg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QVcsRUFBRVQsVUFBVUcsSUFBSSxDQUFDLEVBQUUsRUFBRUUsS0FBS0MsR0FBRyxLQUFLRixNQUFNLEdBQUcsQ0FBQztZQUFDO1lBQ3BGLE1BQU1yQixRQUFRaUMsTUFBTSxDQUFDO2dCQUNuQnZCLFlBQVk7Z0JBQ1p3QixNQUFNO29CQUNKZCxNQUFNSCxVQUFVRyxJQUFJO29CQUNwQlAsT0FBT0c7b0JBQ1BlLFFBQVFGO2dCQUNWO1lBQ0Y7UUFDRixFQUFFLE9BQU9NLEtBQWM7WUFDckIsSUFBSVQsTUFBTSxDQUFDLHdCQUF3QixFQUFFVCxVQUFVRyxJQUFJLENBQUMsQ0FBQztZQUVyRCxJQUFJZSxlQUFlQyxpQkFBYSxFQUFFO2dCQUNoQ1YsT0FBTyxDQUFDLEVBQUUsRUFBRVMsSUFBSUUsT0FBTyxDQUFDLENBQUM7Z0JBQ3pCLElBQUlGLElBQUlHLElBQUksRUFBRVosT0FBTyxDQUFDLEVBQUUsRUFBRVMsSUFBSUcsSUFBSSxDQUFDLENBQUM7WUFDdEM7WUFFQXRDLFFBQVF3QixNQUFNLENBQUNlLEtBQUssQ0FBQztnQkFBRUo7Z0JBQUtUO1lBQUk7WUFDaEMsTUFBTVM7UUFDUjtJQUNGO0FBQ0YifQ==
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migrateStatus.d.ts","sourceRoot":"","sources":["../src/migrateStatus.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,wBAAsB,aAAa,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAuCxE"}
|
package/dist/migrateStatus.js
CHANGED
@@ -20,7 +20,7 @@ async function migrateStatus() {
|
|
20
20
|
msg: `Found ${migrationFiles.length} migration files.`
|
21
21
|
});
|
22
22
|
let existingMigrations = [];
|
23
|
-
const hasMigrationTable = await (0, _migrationTableExists.migrationTableExists)(this.
|
23
|
+
const hasMigrationTable = await (0, _migrationTableExists.migrationTableExists)(this.drizzle);
|
24
24
|
if (hasMigrationTable) {
|
25
25
|
({ existingMigrations } = await (0, _database.getMigrations)({
|
26
26
|
payload
|
@@ -51,4 +51,4 @@ async function migrateStatus() {
|
|
51
51
|
p.printTable();
|
52
52
|
}
|
53
53
|
|
54
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9taWdyYXRlU3RhdHVzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFRhYmxlIH0gZnJvbSAnY29uc29sZS10YWJsZS1wcmludGVyJ1xuaW1wb3J0IHsgZ2V0TWlncmF0aW9ucywgcmVhZE1pZ3JhdGlvbkZpbGVzIH0gZnJvbSAncGF5bG9hZC9kYXRhYmFzZSdcblxuaW1wb3J0IHR5cGUgeyBQb3N0Z3Jlc0FkYXB0ZXIgfSBmcm9tICcuL3R5cGVzJ1xuXG5pbXBvcnQgeyBtaWdyYXRpb25UYWJsZUV4aXN0cyB9IGZyb20gJy4vdXRpbGl0aWVzL21pZ3JhdGlvblRhYmxlRXhpc3RzJ1xuXG5leHBvcnQgYXN5bmMgZnVuY3Rpb24gbWlncmF0ZVN0YXR1cyh0aGlzOiBQb3N0Z3Jlc0FkYXB0ZXIpOiBQcm9taXNlPHZvaWQ+
|
54
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9taWdyYXRlU3RhdHVzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFRhYmxlIH0gZnJvbSAnY29uc29sZS10YWJsZS1wcmludGVyJ1xuaW1wb3J0IHsgZ2V0TWlncmF0aW9ucywgcmVhZE1pZ3JhdGlvbkZpbGVzIH0gZnJvbSAncGF5bG9hZC9kYXRhYmFzZSdcblxuaW1wb3J0IHR5cGUgeyBQb3N0Z3Jlc0FkYX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BTyxDQUFDLENBQUNDO1FBQ2hCSCxFQUFFSSxNQUFNLENBQUNELEdBQUc7WUFDVkUsT0FBT0YsRUFBRUosR0FBRyxLQUFLLFFBQVEsVUFBVTtRQUNyQztJQUNGO0lBQ0FDLEVBQUVNLFVBQVU7QUFDZCJ9
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import type { SQL } from 'drizzle-orm';
|
2
|
+
import type { Field, Where } from 'payload/types';
|
3
|
+
import type { GenericColumn, PostgresAdapter } from '../types';
|
4
|
+
import type { BuildQueryJoinAliases, BuildQueryJoins } from './buildQuery';
|
5
|
+
export declare function buildAndOrConditions({ adapter, fields, joinAliases, joins, locale, selectFields, tableName, where, }: {
|
6
|
+
adapter: PostgresAdapter;
|
7
|
+
collectionSlug?: string;
|
8
|
+
fields: Field[];
|
9
|
+
globalSlug?: string;
|
10
|
+
joinAliases: BuildQueryJoinAliases;
|
11
|
+
joins: BuildQueryJoins;
|
12
|
+
locale?: string;
|
13
|
+
selectFields: Record<string, GenericColumn>;
|
14
|
+
tableName: string;
|
15
|
+
where: Where[];
|
16
|
+
}): Promise<SQL[]>;
|
17
|
+
//# sourceMappingURL=buildAndOrConditions.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"buildAndOrConditions.d.ts","sourceRoot":"","sources":["../../src/queries/buildAndOrConditions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAI1E,wBAAsB,oBAAoB,CAAC,EACzC,OAAO,EACP,MAAM,EACN,WAAW,EACX,KAAK,EACL,MAAM,EACN,YAAY,EACZ,SAAS,EACT,KAAK,GACN,EAAE;IACD,OAAO,EAAE,eAAe,CAAA;IACxB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,qBAAqB,CAAA;IAClC,KAAK,EAAE,eAAe,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IAC3C,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,KAAK,EAAE,CAAA;CACf,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAyBjB"}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import type { SQL } from 'drizzle-orm';
|
2
|
+
import type { Field, Where } from 'payload/types';
|
3
|
+
import { asc, desc } from 'drizzle-orm';
|
4
|
+
import type { GenericColumn, GenericTable, PostgresAdapter } from '../types';
|
5
|
+
export type BuildQueryJoins = Record<string, SQL>;
|
6
|
+
export type BuildQueryJoinAliases = {
|
7
|
+
condition: SQL;
|
8
|
+
table: GenericTable;
|
9
|
+
}[];
|
10
|
+
type BuildQueryArgs = {
|
11
|
+
adapter: PostgresAdapter;
|
12
|
+
fields: Field[];
|
13
|
+
locale?: string;
|
14
|
+
sort?: string;
|
15
|
+
tableName: string;
|
16
|
+
where: Where;
|
17
|
+
};
|
18
|
+
type Result = {
|
19
|
+
joinAliases: BuildQueryJoinAliases;
|
20
|
+
joins: BuildQueryJoins;
|
21
|
+
orderBy: {
|
22
|
+
column: GenericColumn;
|
23
|
+
order: typeof asc | typeof desc;
|
24
|
+
};
|
25
|
+
selectFields: Record<string, GenericColumn>;
|
26
|
+
where: SQL;
|
27
|
+
};
|
28
|
+
declare const buildQuery: ({ adapter, fields, locale, sort, tableName, where: incomingWhere, }: BuildQueryArgs) => Promise<Result>;
|
29
|
+
export default buildQuery;
|
30
|
+
//# sourceMappingURL=buildQuery.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"buildQuery.d.ts","sourceRoot":"","sources":["../../src/queries/buildQuery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAK5E,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAEjD,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,GAAG,CAAA;IACd,KAAK,EAAE,YAAY,CAAA;CACpB,EAAE,CAAA;AAEH,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE,eAAe,CAAA;IACxB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,KAAK,CAAA;CACb,CAAA;AAED,KAAK,MAAM,GAAG;IACZ,WAAW,EAAE,qBAAqB,CAAA;IAClC,KAAK,EAAE,eAAe,CAAA;IACtB,OAAO,EAAE;QACP,MAAM,EAAE,aAAa,CAAA;QACrB,KAAK,EAAE,OAAO,GAAG,GAAG,OAAO,IAAI,CAAA;KAChC,CAAA;IACD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IAC3C,KAAK,EAAE,GAAG,CAAA;CACX,CAAA;AACD,QAAA,MAAM,UAAU,wEAOb,cAAc,KAAG,QAAQ,MAAM,CAyEjC,CAAA;AAED,eAAe,UAAU,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"convertPathToJSONTraversal.d.ts","sourceRoot":"","sources":["../../../src/queries/createJSONQuery/convertPathToJSONTraversal.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,0BAA0B,qBAAsB,MAAM,EAAE,WAUpE,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"formatJSONPathSegment.d.ts","sourceRoot":"","sources":["../../../src/queries/createJSONQuery/formatJSONPathSegment.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,YAAa,MAAM,WAEpD,CAAA"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
type Args = {
|
2
|
+
operator: string;
|
3
|
+
pathSegments: string[];
|
4
|
+
treatAsArray?: string[];
|
5
|
+
treatRootAsArray?: boolean;
|
6
|
+
value: unknown;
|
7
|
+
};
|
8
|
+
export declare const createJSONQuery: ({ operator, pathSegments, treatAsArray, treatRootAsArray, value, }: Args) => string;
|
9
|
+
export {};
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/queries/createJSONQuery/index.ts"],"names":[],"mappings":"AAmDA,KAAK,IAAI,GAAG;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,KAAK,EAAE,OAAO,CAAA;CACf,CAAA;AAED,eAAO,MAAM,eAAe,uEAMzB,IAAI,KAAG,MAqBT,CAAA"}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import type { SQL } from 'drizzle-orm';
|
2
|
+
import type { Field, FieldAffectingData, TabAsField } from 'payload/types';
|
3
|
+
import type { GenericColumn, GenericTable, PostgresAdapter } from '../types';
|
4
|
+
import type { BuildQueryJoinAliases, BuildQueryJoins } from './buildQuery';
|
5
|
+
type Constraint = {
|
6
|
+
columnName: string;
|
7
|
+
table: GenericTable;
|
8
|
+
value: unknown;
|
9
|
+
};
|
10
|
+
type TableColumn = {
|
11
|
+
columnName?: string;
|
12
|
+
constraints: Constraint[];
|
13
|
+
field: FieldAffectingData;
|
14
|
+
getNotNullColumnByValue?: (val: unknown) => string;
|
15
|
+
pathSegments?: string[];
|
16
|
+
rawColumn?: SQL;
|
17
|
+
table: GenericTable;
|
18
|
+
};
|
19
|
+
type Args = {
|
20
|
+
adapter: PostgresAdapter;
|
21
|
+
aliasTable?: GenericTable;
|
22
|
+
collectionPath: string;
|
23
|
+
columnPrefix?: string;
|
24
|
+
constraints?: Constraint[];
|
25
|
+
fields: (Field | TabAsField)[];
|
26
|
+
joinAliases: BuildQueryJoinAliases;
|
27
|
+
joins: BuildQueryJoins;
|
28
|
+
locale?: string;
|
29
|
+
pathSegments: string[];
|
30
|
+
selectFields: Record<string, GenericColumn>;
|
31
|
+
tableName: string;
|
32
|
+
};
|
33
|
+
/**
|
34
|
+
* Transforms path to table and column name
|
35
|
+
* Adds tables to `join`
|
36
|
+
* @returns TableColumn
|
37
|
+
*/
|
38
|
+
export declare const getTableColumnFromPath: ({ adapter, aliasTable, collectionPath, columnPrefix, constraints, fields, joinAliases, joins, locale: incomingLocale, pathSegments: incomingSegments, selectFields, tableName, }: Args) => TableColumn;
|
39
|
+
export {};
|
40
|
+
//# sourceMappingURL=getTableColumnFromPath.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getTableColumnFromPath.d.ts","sourceRoot":"","sources":["../../src/queries/getTableColumnFromPath.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAU1E,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE1E,KAAK,UAAU,GAAG;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,YAAY,CAAA;IACnB,KAAK,EAAE,OAAO,CAAA;CACf,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,UAAU,EAAE,CAAA;IACzB,KAAK,EAAE,kBAAkB,CAAA;IACzB,uBAAuB,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,MAAM,CAAA;IAClD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,SAAS,CAAC,EAAE,GAAG,CAAA;IACf,KAAK,EAAE,YAAY,CAAA;CACpB,CAAA;AAED,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,eAAe,CAAA;IACxB,UAAU,CAAC,EAAE,YAAY,CAAA;IACzB,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,UAAU,EAAE,CAAA;IAC1B,MAAM,EAAE,CAAC,KAAK,GAAG,UAAU,CAAC,EAAE,CAAA;IAC9B,WAAW,EAAE,qBAAqB,CAAA;IAClC,KAAK,EAAE,eAAe,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IAC3C,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AACD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,qLAahC,IAAI,KAAG,WAgWT,CAAA"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { and, ilike, inArray, isNotNull, isNull, notInArray, or } from 'drizzle-orm';
|
2
|
+
export declare const operatorMap: {
|
3
|
+
and: typeof and;
|
4
|
+
contains: typeof ilike;
|
5
|
+
equals: import("drizzle-orm").BinaryOperator;
|
6
|
+
exists: typeof isNotNull;
|
7
|
+
greater_than: import("drizzle-orm").BinaryOperator;
|
8
|
+
greater_than_equal: import("drizzle-orm").BinaryOperator;
|
9
|
+
in: typeof inArray;
|
10
|
+
isNull: typeof isNull;
|
11
|
+
less_than: import("drizzle-orm").BinaryOperator;
|
12
|
+
less_than_equal: import("drizzle-orm").BinaryOperator;
|
13
|
+
like: typeof ilike;
|
14
|
+
not_equals: import("drizzle-orm").BinaryOperator;
|
15
|
+
not_in: typeof notInArray;
|
16
|
+
or: typeof or;
|
17
|
+
};
|
18
|
+
//# sourceMappingURL=operatorMap.d.ts.map
|