@payloadcms/db-postgres 0.1.0-beta.1 → 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 +5 -5
- 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 -2
- 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 +5 -4
- package/src/index.ts +8 -4
- package/dist/mock.js +0 -13
- package/dist/webpack.js +0 -32
@@ -0,0 +1,46 @@
|
|
1
|
+
import type { Field } from 'payload/types';
|
2
|
+
import type { ArrayRowToInsert, BlockRowToInsert, RelationshipToDelete } from './types';
|
3
|
+
type Args = {
|
4
|
+
arrays: {
|
5
|
+
[tableName: string]: ArrayRowToInsert[];
|
6
|
+
};
|
7
|
+
/**
|
8
|
+
* This is the name of the base table
|
9
|
+
*/
|
10
|
+
baseTableName: string;
|
11
|
+
blocks: {
|
12
|
+
[blockType: string]: BlockRowToInsert[];
|
13
|
+
};
|
14
|
+
/**
|
15
|
+
* A snake-case field prefix, representing prior fields
|
16
|
+
* Ex: my_group_my_named_tab_
|
17
|
+
*/
|
18
|
+
columnPrefix: string;
|
19
|
+
data: Record<string, unknown>;
|
20
|
+
existingLocales?: Record<string, unknown>[];
|
21
|
+
/**
|
22
|
+
* A prefix that will retain camel-case formatting, representing prior fields
|
23
|
+
* Ex: myGroup_myNamedTab_
|
24
|
+
*/
|
25
|
+
fieldPrefix: string;
|
26
|
+
fields: Field[];
|
27
|
+
forcedLocale?: string;
|
28
|
+
locales: {
|
29
|
+
[locale: string]: Record<string, unknown>;
|
30
|
+
};
|
31
|
+
numbers: Record<string, unknown>[];
|
32
|
+
/**
|
33
|
+
* This is the name of the parent table
|
34
|
+
*/
|
35
|
+
parentTableName: string;
|
36
|
+
path: string;
|
37
|
+
relationships: Record<string, unknown>[];
|
38
|
+
relationshipsToDelete: RelationshipToDelete[];
|
39
|
+
row: Record<string, unknown>;
|
40
|
+
selects: {
|
41
|
+
[tableName: string]: Record<string, unknown>[];
|
42
|
+
};
|
43
|
+
};
|
44
|
+
export declare const traverseFields: ({ arrays, baseTableName, blocks, columnPrefix, data, existingLocales, fieldPrefix, fields, forcedLocale, locales, numbers, parentTableName, path, relationships, relationshipsToDelete, row, selects, }: Args) => void;
|
45
|
+
export {};
|
46
|
+
//# sourceMappingURL=traverseFields.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"traverseFields.d.ts","sourceRoot":"","sources":["../../../src/transform/write/traverseFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAK1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AASvF,KAAK,IAAI,GAAG;IACV,MAAM,EAAE;QACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;KACxC,CAAA;IACD;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE;QACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;KACxC,CAAA;IACD;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC3C;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE;QACP,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAC1C,CAAA;IACD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAClC;;OAEG;IACH,eAAe,EAAE,MAAM,CAAA;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IACxC,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5B,OAAO,EAAE;QACP,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;KAC/C,CAAA;CACF,CAAA;AAED,eAAO,MAAM,cAAc,4MAkBxB,IAAI,SA8XN,CAAA"}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
export type ArrayRowToInsert = {
|
2
|
+
arrays: {
|
3
|
+
[tableName: string]: ArrayRowToInsert[];
|
4
|
+
};
|
5
|
+
locales: {
|
6
|
+
[locale: string]: Record<string, unknown>;
|
7
|
+
};
|
8
|
+
row: Record<string, unknown>;
|
9
|
+
};
|
10
|
+
export type BlockRowToInsert = {
|
11
|
+
arrays: {
|
12
|
+
[tableName: string]: ArrayRowToInsert[];
|
13
|
+
};
|
14
|
+
locales: {
|
15
|
+
[locale: string]: Record<string, unknown>;
|
16
|
+
};
|
17
|
+
row: Record<string, unknown>;
|
18
|
+
};
|
19
|
+
export type RelationshipToDelete = {
|
20
|
+
locale?: string;
|
21
|
+
path: string;
|
22
|
+
};
|
23
|
+
export type RowToInsert = {
|
24
|
+
arrays: {
|
25
|
+
[tableName: string]: ArrayRowToInsert[];
|
26
|
+
};
|
27
|
+
blocks: {
|
28
|
+
[blockType: string]: BlockRowToInsert[];
|
29
|
+
};
|
30
|
+
locales: {
|
31
|
+
[locale: string]: Record<string, unknown>;
|
32
|
+
};
|
33
|
+
numbers: Record<string, unknown>[];
|
34
|
+
relationships: Record<string, unknown>[];
|
35
|
+
relationshipsToDelete: RelationshipToDelete[];
|
36
|
+
row: Record<string, unknown>;
|
37
|
+
selects: {
|
38
|
+
[tableName: string]: Record<string, unknown>[];
|
39
|
+
};
|
40
|
+
};
|
41
|
+
//# sourceMappingURL=types.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/transform/write/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE;QACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;KACxC,CAAA;IACD,OAAO,EAAE;QACP,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAC1C,CAAA;IACD,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE;QACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;KACxC,CAAA;IACD,OAAO,EAAE;QACP,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAC1C,CAAA;IACD,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE;QACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;KACxC,CAAA;IACD,MAAM,EAAE;QACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;KACxC,CAAA;IACD,OAAO,EAAE;QACP,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAC1C,CAAA;IACD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAClC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IACxC,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5B,OAAO,EAAE;QACP,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;KAC/C,CAAA;CACF,CAAA"}
|
package/dist/types.d.ts
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
import type { ColumnBaseConfig, ColumnDataType, ExtractTablesWithRelations, Relation, Relations } from 'drizzle-orm';
|
2
|
+
import type { NodePgDatabase, NodePgQueryResultHKT } from 'drizzle-orm/node-postgres';
|
3
|
+
import type { PgColumn, PgEnum, PgTableWithColumns, PgTransaction } from 'drizzle-orm/pg-core';
|
4
|
+
import type { Payload } from 'payload';
|
5
|
+
import type { BaseDatabaseAdapter } from 'payload/database';
|
6
|
+
import type { Pool, PoolConfig } from 'pg';
|
7
|
+
export type DrizzleDB = NodePgDatabase<Record<string, unknown>>;
|
8
|
+
export type Args = {
|
9
|
+
client: PoolConfig;
|
10
|
+
migrationDir?: string;
|
11
|
+
migrationName?: string;
|
12
|
+
};
|
13
|
+
export type GenericColumn = PgColumn<ColumnBaseConfig<ColumnDataType, string>, Record<string, unknown>>;
|
14
|
+
export type GenericColumns = {
|
15
|
+
[x: string]: GenericColumn;
|
16
|
+
};
|
17
|
+
export type GenericTable = PgTableWithColumns<{
|
18
|
+
columns: GenericColumns;
|
19
|
+
dialect: string;
|
20
|
+
name: string;
|
21
|
+
schema: undefined;
|
22
|
+
}>;
|
23
|
+
export type GenericEnum = PgEnum<[string, ...string[]]>;
|
24
|
+
export type GenericRelation = Relations<string, Record<string, Relation<string>>>;
|
25
|
+
export type DrizzleTransaction = PgTransaction<NodePgQueryResultHKT, Record<string, unknown>, ExtractTablesWithRelations<Record<string, unknown>>>;
|
26
|
+
export type PostgresAdapter = BaseDatabaseAdapter & Args & {
|
27
|
+
drizzle: DrizzleDB;
|
28
|
+
enums: Record<string, GenericEnum>;
|
29
|
+
pool: Pool;
|
30
|
+
relations: Record<string, GenericRelation>;
|
31
|
+
schema: Record<string, GenericEnum | GenericRelation | GenericTable>;
|
32
|
+
sessions: {
|
33
|
+
[id: string]: {
|
34
|
+
db: DrizzleTransaction;
|
35
|
+
reject: () => void;
|
36
|
+
resolve: () => void;
|
37
|
+
};
|
38
|
+
};
|
39
|
+
tables: Record<string, GenericTable>;
|
40
|
+
};
|
41
|
+
export type PostgresAdapterResult = (args: {
|
42
|
+
payload: Payload;
|
43
|
+
}) => PostgresAdapter;
|
44
|
+
export type MigrateUpArgs = {
|
45
|
+
payload: Payload;
|
46
|
+
};
|
47
|
+
export type MigrateDownArgs = {
|
48
|
+
payload: Payload;
|
49
|
+
};
|
50
|
+
declare module 'payload' {
|
51
|
+
interface DatabaseAdapter extends Args {
|
52
|
+
drizzle: DrizzleDB;
|
53
|
+
enums: Record<string, GenericEnum>;
|
54
|
+
pool: Pool;
|
55
|
+
relations: Record<string, GenericRelation>;
|
56
|
+
schema: Record<string, GenericEnum | GenericRelation | GenericTable>;
|
57
|
+
sessions: {
|
58
|
+
[id: string]: {
|
59
|
+
db: DrizzleTransaction;
|
60
|
+
reject: () => void;
|
61
|
+
resolve: () => void;
|
62
|
+
};
|
63
|
+
};
|
64
|
+
tables: Record<string, GenericTable>;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
//# sourceMappingURL=types.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,0BAA0B,EAC1B,QAAQ,EACR,SAAS,EACV,MAAM,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;QAC1C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,eAAe,GAAG,YAAY,CAAC,CAAA;QACpE,QAAQ,EAAE;YACR,CAAC,EAAE,EAAE,MAAM,GAAG;gBACZ,EAAE,EAAE,kBAAkB,CAAA;gBACtB,MAAM,EAAE,MAAM,IAAI,CAAA;gBAClB,OAAO,EAAE,MAAM,IAAI,CAAA;aACpB,CAAA;SACF,CAAA;QACD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;KACrC;CACF"}
|
package/dist/update.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../src/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AASjD,eAAO,MAAM,SAAS,EAAE,SA6BvB,CAAA"}
|
package/dist/update.js
CHANGED
@@ -17,7 +17,7 @@ function _interop_require_default(obj) {
|
|
17
17
|
};
|
18
18
|
}
|
19
19
|
const updateOne = async function updateOne({ id, collection: collectionSlug, data, draft, locale, req, where: whereArg }) {
|
20
|
-
const db = this.sessions[req.transactionID]?.db || this.
|
20
|
+
const db = this.sessions[req.transactionID]?.db || this.drizzle;
|
21
21
|
const collection = this.payload.collections[collectionSlug].config;
|
22
22
|
const tableName = (0, _tosnakecase.default)(collectionSlug);
|
23
23
|
const whereToUse = whereArg || {
|
@@ -45,4 +45,4 @@ const updateOne = async function updateOne({ id, collection: collectionSlug, dat
|
|
45
45
|
return result;
|
46
46
|
};
|
47
47
|
|
48
|
-
//# sourceMappingURL=data:application/json;base64,
|
48
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy91cGRhdGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBVcGRhdGVPbmUgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1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sQ0FBQ1osZUFBZSxDQUFDYSxNQUFNO0lBQ2xFLE1BQU1DLFlBQVlDLElBQUFBLG9CQUFXLEVBQUNmO0lBQzlCLE1BQU1nQixhQUFhVixZQUFZO1FBQUVSLElBQUk7WUFBRW1CLFFBQVFuQjtRQUFHO0lBQUU7SUFFcEQsTUFBTSxFQUFFTyxLQUFLLEVBQUUsR0FBRyxNQUFNYSxJQUFBQSxtQkFBVSxFQUFDO1FBQ2pDQyxTQUFTLElBQUk7UUFDYkMsUUFBUXJCLFdBQVdxQixNQUFNO1FBQ3pCakI7UUFDQVc7UUFDQVQsT0FBT1c7SUFDVDtJQUVBLE1BQU1LLFNBQVMsTUFBTUMsSUFBQUEsb0JBQVMsRUFBQztRQUM3QnhCO1FBQ0FxQixTQUFTLElBQUk7UUFDYmxCO1FBQ0FNO1FBQ0FhLFFBQVFyQixXQUFXcUIsTUFBTTtRQUN6QkcsV0FBVztRQUNYVCxXQUFXQyxJQUFBQSxvQkFBVyxFQUFDZjtRQUN2Qks7SUFDRjtJQUVBLE9BQU9nQjtBQUNUIn0=
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { UpdateGlobalArgs } from 'payload/database';
|
2
|
+
import type { TypeWithID } from 'payload/types';
|
3
|
+
import type { PostgresAdapter } from './types';
|
4
|
+
export declare function updateGlobal<T extends TypeWithID>(this: PostgresAdapter, { data, req, slug }: UpdateGlobalArgs): Promise<T>;
|
5
|
+
//# sourceMappingURL=updateGlobal.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"updateGlobal.d.ts","sourceRoot":"","sources":["../src/updateGlobal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAkB,UAAU,EAAE,MAAM,eAAe,CAAA;AAI/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,wBAAsB,YAAY,CAAC,CAAC,SAAS,UAAU,EACrD,IAAI,EAAE,eAAe,EACrB,EAAE,IAAI,EAAE,GAA0B,EAAE,IAAI,EAAE,EAAE,gBAAgB,GAC3D,OAAO,CAAC,CAAC,CAAC,CAiBZ"}
|
package/dist/updateGlobal.js
CHANGED
@@ -16,7 +16,7 @@ function _interop_require_default(obj) {
|
|
16
16
|
};
|
17
17
|
}
|
18
18
|
async function updateGlobal({ data, req = {}, slug }) {
|
19
|
-
const db = this.sessions[req.transactionID]?.db || this.
|
19
|
+
const db = this.sessions[req.transactionID]?.db || this.drizzle;
|
20
20
|
const globalConfig = this.payload.globals.config.find((config)=>config.slug === slug);
|
21
21
|
const tableName = (0, _tosnakecase.default)(slug);
|
22
22
|
const existingGlobal = await db.query[tableName].findFirst({});
|
@@ -36,4 +36,4 @@ async function updateGlobal({ data, req = {}, slug }) {
|
|
36
36
|
return result;
|
37
37
|
}
|
38
38
|
|
39
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy91cGRhdGVHbG9iYWwudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBVcGRhdGVHbG9iYWxBcmdzIH0gZnJvbSAncGF5bG9hZC9kYXRhYmFzZSdcbmltcG9ydCB0eXBlIHsgUGF5bG9hZFJlcXVlc3QsIFR5cGVXaXRoSUQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgdG9TbmFrZUNhc2UgZnJvbSAndG8tc25ha2UtY2FzZSdcblxuaW1wb3J0IHR5cGUgeyBQb3N0Z3Jlc0FkYXB0ZXIgfSBmcm9tICcuL3R5cGVzJ1xuXG5pbXBvcnQgeyB1cHNlcnRSb3cgfSBmcm9tICcuL3Vwc2VydFJvdydcblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIHVwZGF0ZUdsb2JhbDxUIGV4dGVuZHMgVHlwZVdpdGhJRD4oXG4gIHRoaXM6IFBvc3RncmVzQWR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yxRQUFRLENBQUNILElBQUlJLGFBQWEsQ0FBQyxFQUFFRixNQUFNLElBQUksQ0FBQ0csT0FBTztJQUMvRCxNQUFNQyxlQUFlLElBQUksQ0FBQ0MsT0FBTyxDQUFDQyxPQUFPLENBQUNDLE1BQU0sQ0FBQ0MsSUFBSSxDQUFDLENBQUNELFNBQVdBLE9BQU9SLElBQUksS0FBS0E7SUFDbEYsTUFBTVUsWUFBWUMsSUFBQUEsb0JBQVcsRUFBQ1g7SUFFOUIsTUFBTVksaUJBQWlCLE1BQU1YLEdBQUdZLEtBQUssQ0FBQ0gsVUFBVSxDQUFDSSxTQUFTLENBQUMsQ0FBQztJQUU1RCxNQUFNQyxTQUFTLE1BQU1DLElBQUFBLG9CQUFTLEVBQUk7UUFDaEMsR0FBSUosaUJBQWlCO1lBQUVLLElBQUlMLGVBQWVLLEVBQUU7WUFBRUMsV0FBVztRQUFTLElBQUk7WUFBRUEsV0FBVztRQUFTLENBQUM7UUFDN0ZDLFNBQVMsSUFBSTtRQUNickI7UUFDQUc7UUFDQW1CLFFBQVFmLGFBQWFlLE1BQU07UUFDM0JWO0lBQ0Y7SUFFQSxPQUFPSztBQUNUIn0=
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import type { TypeWithVersion } from 'payload/database';
|
2
|
+
import type { UpdateGlobalVersionArgs } from 'payload/database';
|
3
|
+
import type { TypeWithID } from 'payload/types';
|
4
|
+
import type { PostgresAdapter } from './types';
|
5
|
+
export declare function updateGlobalVersion<T extends TypeWithID>(this: PostgresAdapter, { id, global, locale, req, versionData, where: whereArg, }: UpdateGlobalVersionArgs<T>): Promise<TypeWithVersion<T>>;
|
6
|
+
//# sourceMappingURL=updateGlobalVersion.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"updateGlobalVersion.d.ts","sourceRoot":"","sources":["../src/updateGlobalVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,KAAK,EAAyC,UAAU,EAAE,MAAM,eAAe,CAAA;AAKtF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAK9C,wBAAsB,mBAAmB,CAAC,CAAC,SAAS,UAAU,EAC5D,IAAI,EAAE,eAAe,EACrB,EACE,EAAE,EACF,MAAM,EACN,MAAM,EACN,GAA0B,EAC1B,WAAW,EACX,KAAK,EAAE,QAAQ,GAChB,EAAE,uBAAuB,CAAC,CAAC,CAAC,+BA8B9B"}
|
@@ -18,7 +18,7 @@ function _interop_require_default(obj) {
|
|
18
18
|
};
|
19
19
|
}
|
20
20
|
async function updateGlobalVersion({ id, global, locale, req = {}, versionData, where: whereArg }) {
|
21
|
-
const db = this.sessions[req.transactionID]?.db || this.
|
21
|
+
const db = this.sessions[req.transactionID]?.db || this.drizzle;
|
22
22
|
const globalConfig = this.payload.globals.config.find(({ slug })=>slug === global);
|
23
23
|
const whereToUse = whereArg || {
|
24
24
|
id: {
|
@@ -47,4 +47,4 @@ async function updateGlobalVersion({ id, global, locale, req = {}, versionData,
|
|
47
47
|
return result;
|
48
48
|
}
|
49
49
|
|
50
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy91cGRhdGVHbG9iYWxWZXJzaW9uLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgVHlwZVdpdGhWZXJzaW9uIH0gZnJvbSAncGF5bG9hZC9kYXRhYmFzZSdcbmltcG9ydCB0eXBlIHsgVXBkYXRlR2xvYmFsVmVyc2lvbkFyZ3MgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuaW1wb3J0IHR5cGUgeyBQYXlsb2FkUmVxdWVzdCwgU2FuaXRpemVkR2xvYmFsQ29uZmlnLCBUeXBlV2l0aElEIH0gZnJvbSAncGF5bG9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
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { TypeWithVersion, UpdateVersionArgs } from 'payload/database';
|
2
|
+
import type { TypeWithID } from 'payload/types';
|
3
|
+
import type { PostgresAdapter } from './types';
|
4
|
+
export declare function updateVersion<T extends TypeWithID>(this: PostgresAdapter, { id, collection, locale, req, versionData, where: whereArg, }: UpdateVersionArgs<T>): Promise<TypeWithVersion<T>>;
|
5
|
+
//# sourceMappingURL=updateVersion.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"updateVersion.d.ts","sourceRoot":"","sources":["../src/updateVersion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAC1E,OAAO,KAAK,EAA6C,UAAU,EAAE,MAAM,eAAe,CAAA;AAK1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAK9C,wBAAsB,aAAa,CAAC,CAAC,SAAS,UAAU,EACtD,IAAI,EAAE,eAAe,EACrB,EACE,EAAE,EACF,UAAU,EACV,MAAM,EACN,GAA0B,EAC1B,WAAW,EACX,KAAK,EAAE,QAAQ,GAChB,EAAE,iBAAiB,CAAC,CAAC,CAAC,+BA4BxB"}
|
package/dist/updateVersion.js
CHANGED
@@ -18,7 +18,7 @@ function _interop_require_default(obj) {
|
|
18
18
|
};
|
19
19
|
}
|
20
20
|
async function updateVersion({ id, collection, locale, req = {}, versionData, where: whereArg }) {
|
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 whereToUse = whereArg || {
|
24
24
|
id: {
|
@@ -47,4 +47,4 @@ async function updateVersion({ id, collection, locale, req = {}, versionData, wh
|
|
47
47
|
return result;
|
48
48
|
}
|
49
49
|
|
50
|
-
//# sourceMappingURL=data:application/json;base64,
|
50
|
+
//# sourceMappingURL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QUFTLE1BQU1DLElBQUFBLG9CQUFTLEVBQXFCO1FBQ2pEeEI7UUFDQXNCLFNBQVMsSUFBSTtRQUNiRyxNQUFNckI7UUFDTkc7UUFDQVk7UUFDQU8sV0FBVztRQUNYVDtRQUNBWjtJQUNGO0lBRUEsT0FBT2tCO0FBQ1QifQ==
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import type { DrizzleDB, PostgresAdapter } from '../types';
|
2
|
+
type Args = {
|
3
|
+
adapter: PostgresAdapter;
|
4
|
+
db: DrizzleDB;
|
5
|
+
parentID: unknown;
|
6
|
+
tableName: string;
|
7
|
+
};
|
8
|
+
export declare const deleteExistingArrayRows: ({ adapter, db, parentID, tableName, }: Args) => Promise<void>;
|
9
|
+
export {};
|
10
|
+
//# sourceMappingURL=deleteExistingArrayRows.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"deleteExistingArrayRows.d.ts","sourceRoot":"","sources":["../../src/upsertRow/deleteExistingArrayRows.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE1D,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,eAAe,CAAA;IACxB,EAAE,EAAE,SAAS,CAAA;IACb,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,uBAAuB,0CAKjC,IAAI,KAAG,QAAQ,IAAI,CAMrB,CAAA"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import type { DrizzleDB, PostgresAdapter } from '../types';
|
2
|
+
type Args = {
|
3
|
+
adapter: PostgresAdapter;
|
4
|
+
db: DrizzleDB;
|
5
|
+
localeColumnName?: string;
|
6
|
+
parentColumnName?: string;
|
7
|
+
parentID: unknown;
|
8
|
+
pathColumnName?: string;
|
9
|
+
rows: Record<string, unknown>[];
|
10
|
+
tableName: string;
|
11
|
+
};
|
12
|
+
export declare const deleteExistingRowsByPath: ({ adapter, db, localeColumnName, parentColumnName, parentID, pathColumnName, rows, tableName, }: Args) => Promise<void>;
|
13
|
+
export {};
|
14
|
+
//# sourceMappingURL=deleteExistingRowsByPath.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"deleteExistingRowsByPath.d.ts","sourceRoot":"","sources":["../../src/upsertRow/deleteExistingRowsByPath.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE1D,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,eAAe,CAAA;IACxB,EAAE,EAAE,SAAS,CAAA;IACb,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,EAAE,OAAO,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC/B,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,wBAAwB,oGASlC,IAAI,KAAG,QAAQ,IAAI,CAkCrB,CAAA"}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import type { TypeWithID } from 'payload/types';
|
2
|
+
import type { Args } from './types';
|
3
|
+
export declare const upsertRow: <T extends TypeWithID>({ id, adapter, data, db, fields, operation, path, tableName, upsertTarget, where, }: Args) => Promise<T>;
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/upsertRow/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAK/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AASnC,eAAO,MAAM,SAAS,8GAWnB,IAAI,eA0QN,CAAA"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import type { ArrayRowToInsert } from '../transform/write/types';
|
2
|
+
import type { DrizzleDB, PostgresAdapter } from '../types';
|
3
|
+
type Args = {
|
4
|
+
adapter: PostgresAdapter;
|
5
|
+
arrays: {
|
6
|
+
[tableName: string]: ArrayRowToInsert[];
|
7
|
+
}[];
|
8
|
+
db: DrizzleDB;
|
9
|
+
parentRows: Record<string, unknown>[];
|
10
|
+
};
|
11
|
+
export declare const insertArrays: ({ adapter, arrays, db, parentRows }: Args) => Promise<void>;
|
12
|
+
export {};
|
13
|
+
//# sourceMappingURL=insertArrays.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"insertArrays.d.ts","sourceRoot":"","sources":["../../src/upsertRow/insertArrays.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE1D,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,eAAe,CAAA;IACxB,MAAM,EAAE;QACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;KACxC,EAAE,CAAA;IACH,EAAE,EAAE,SAAS,CAAA;IACb,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CACtC,CAAA;AAYD,eAAO,MAAM,YAAY,wCAA+C,IAAI,KAAG,QAAQ,IAAI,CA2D1F,CAAA"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import type { SQL } from 'drizzle-orm';
|
2
|
+
import type { Field } from 'payload/types';
|
3
|
+
import type { DrizzleDB, GenericColumn, PostgresAdapter } from '../types';
|
4
|
+
type BaseArgs = {
|
5
|
+
adapter: PostgresAdapter;
|
6
|
+
data: Record<string, unknown>;
|
7
|
+
db: DrizzleDB;
|
8
|
+
fields: Field[];
|
9
|
+
path?: string;
|
10
|
+
tableName: string;
|
11
|
+
};
|
12
|
+
type CreateArgs = BaseArgs & {
|
13
|
+
id?: never;
|
14
|
+
operation: 'create';
|
15
|
+
upsertTarget?: never;
|
16
|
+
where?: never;
|
17
|
+
};
|
18
|
+
type UpdateArgs = BaseArgs & {
|
19
|
+
id?: number | string;
|
20
|
+
operation: 'update';
|
21
|
+
upsertTarget?: GenericColumn;
|
22
|
+
where?: SQL<unknown>;
|
23
|
+
};
|
24
|
+
export type Args = CreateArgs | UpdateArgs;
|
25
|
+
export {};
|
26
|
+
//# sourceMappingURL=types.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/upsertRow/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAEzE,KAAK,QAAQ,GAAG;IACd,OAAO,EAAE,eAAe,CAAA;IACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,EAAE,EAAE,SAAS,CAAA;IACb,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,KAAK,UAAU,GAAG,QAAQ,GAAG;IAC3B,EAAE,CAAC,EAAE,KAAK,CAAA;IACV,SAAS,EAAE,QAAQ,CAAA;IACnB,YAAY,CAAC,EAAE,KAAK,CAAA;IACpB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED,KAAK,UAAU,GAAG,QAAQ,GAAG;IAC3B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,SAAS,EAAE,QAAQ,CAAA;IACnB,YAAY,CAAC,EAAE,aAAa,CAAA;IAC5B,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"appendPrefixToKeys.d.ts","sourceRoot":"","sources":["../../src/utilities/appendPrefixToKeys.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,WAAY,OAAO,MAAM,EAAE,OAAO,CAAC,UAAU,MAAM,MAI3E,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"createBlocksMap.d.ts","sourceRoot":"","sources":["../../src/utilities/createBlocksMap.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CAC1C,CAAA;AAED,eAAO,MAAM,eAAe,SAAU,OAAO,MAAM,EAAE,OAAO,CAAC,KAAG,SAmC/D,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"createMigrationTable.d.ts","sourceRoot":"","sources":["../../src/utilities/createMigrationTable.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,eAAO,MAAM,oBAAoB,qBAA0B,QAAQ,IAAI,CAStE,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"createRelationshipMap.d.ts","sourceRoot":"","sources":["../../src/utilities/createRelationshipMap.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,SAAU,OAAO,KAAG,OAAO,MAAM,EAAE,OAAO,MAAM,EAAE,OAAO,CAAC,EAAE,CAmBrF,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"hasLocalesTable.d.ts","sourceRoot":"","sources":["../../src/utilities/hasLocalesTable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAI1C,eAAO,MAAM,eAAe,WAAY,KAAK,EAAE,KAAG,OAOjD,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"isArrayOfRows.d.ts","sourceRoot":"","sources":["../../src/utilities/isArrayOfRows.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAE9E"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"migrationTableExists.d.ts","sourceRoot":"","sources":["../../src/utilities/migrationTableExists.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,eAAO,MAAM,oBAAoB,qBAA0B,QAAQ,OAAO,CAMzE,CAAA"}
|
package/mock.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export const postgresAdapter = () => ({})
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@payloadcms/db-postgres",
|
3
|
-
"version": "0.1.0-beta.
|
3
|
+
"version": "0.1.0-beta.10",
|
4
4
|
"description": "The officially supported Postgres database adapter for Payload",
|
5
5
|
"repository": "https://github.com/payloadcms/payload",
|
6
6
|
"license": "MIT",
|
@@ -24,7 +24,7 @@
|
|
24
24
|
"devDependencies": {
|
25
25
|
"@types/pg": "8.10.2",
|
26
26
|
"@types/to-snake-case": "1.0.0",
|
27
|
-
"payload": "2.0.0-beta.
|
27
|
+
"payload": "2.0.0-beta.10",
|
28
28
|
"@payloadcms/eslint-config": "0.0.1"
|
29
29
|
},
|
30
30
|
"peerDependencies": {
|
@@ -34,12 +34,13 @@
|
|
34
34
|
"registry": "https://registry.npmjs.org/"
|
35
35
|
},
|
36
36
|
"files": [
|
37
|
-
"dist"
|
37
|
+
"dist",
|
38
|
+
"mock.js"
|
38
39
|
],
|
39
40
|
"scripts": {
|
40
41
|
"build": "pnpm build:swc && pnpm build:types",
|
41
42
|
"build:swc": "swc ./src -d ./dist --config-file .swcrc",
|
42
43
|
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
43
|
-
"clean": "rimraf dist"
|
44
|
+
"clean": "rimraf {dist,*.tsbuildinfo}"
|
44
45
|
}
|
45
46
|
}
|
package/src/index.ts
CHANGED
@@ -17,6 +17,8 @@ import { deleteMany } from './deleteMany'
|
|
17
17
|
import { deleteOne } from './deleteOne'
|
18
18
|
import { deleteVersions } from './deleteVersions'
|
19
19
|
import { destroy } from './destroy'
|
20
|
+
import { extendViteConfig } from './extendViteConfig'
|
21
|
+
import { extendWebpackConfig } from './extendWebpackConfig'
|
20
22
|
import { find } from './find'
|
21
23
|
import { findGlobal } from './findGlobal'
|
22
24
|
import { findGlobalVersions } from './findGlobalVersions'
|
@@ -33,17 +35,20 @@ import { updateOne } from './update'
|
|
33
35
|
import { updateGlobal } from './updateGlobal'
|
34
36
|
import { updateGlobalVersion } from './updateGlobalVersion'
|
35
37
|
import { updateVersion } from './updateVersion'
|
36
|
-
import { webpack } from './webpack'
|
37
38
|
|
38
39
|
export function postgresAdapter(args: Args): PostgresAdapterResult {
|
39
40
|
function adapter({ payload }: { payload: Payload }) {
|
40
|
-
const migrationDir = args.migrationDir || path.resolve(
|
41
|
+
const migrationDir = args.migrationDir || path.resolve(process.cwd(), 'src/migrations')
|
42
|
+
|
43
|
+
extendWebpackConfig(payload.config)
|
44
|
+
extendViteConfig(payload.config)
|
45
|
+
|
41
46
|
return createDatabaseAdapter<PostgresAdapter>({
|
42
47
|
...args,
|
43
48
|
name: 'postgres',
|
44
49
|
|
45
50
|
// Postgres-specific
|
46
|
-
|
51
|
+
drizzle: undefined,
|
47
52
|
enums: {},
|
48
53
|
pool: undefined,
|
49
54
|
relations: {},
|
@@ -81,7 +86,6 @@ export function postgresAdapter(args: Args): PostgresAdapterResult {
|
|
81
86
|
updateGlobalVersion,
|
82
87
|
updateOne,
|
83
88
|
updateVersion,
|
84
|
-
webpack,
|
85
89
|
})
|
86
90
|
}
|
87
91
|
|
package/dist/mock.js
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
3
|
-
value: true
|
4
|
-
});
|
5
|
-
Object.defineProperty(exports, "postgresAdapter", {
|
6
|
-
enumerable: true,
|
7
|
-
get: function() {
|
8
|
-
return postgresAdapter;
|
9
|
-
}
|
10
|
-
});
|
11
|
-
const postgresAdapter = ()=>({});
|
12
|
-
|
13
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9tb2NrLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBjb25zdCBwb3N0Z3Jlc0FkYXB0ZXIgPSAoKSA9PiAoe30pXG4iXSwibmFtZXMiOlsicG9zdGdyZXNBZGFwdGVyIl0sIm1hcHBpbmdzIjoiOzs7OytCQUFhQTs7O2VBQUFBOzs7QUFBTixNQUFNQSxrQkFBa0IsSUFBTyxDQUFBLENBQUMsQ0FBQSJ9
|
package/dist/webpack.js
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
3
|
-
value: true
|
4
|
-
});
|
5
|
-
Object.defineProperty(exports, "webpack", {
|
6
|
-
enumerable: true,
|
7
|
-
get: function() {
|
8
|
-
return webpack;
|
9
|
-
}
|
10
|
-
});
|
11
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
12
|
-
function _interop_require_default(obj) {
|
13
|
-
return obj && obj.__esModule ? obj : {
|
14
|
-
default: obj
|
15
|
-
};
|
16
|
-
}
|
17
|
-
const webpack = (config)=>{
|
18
|
-
const aliasPath = _path.default.resolve(__dirname, 'mock.js');
|
19
|
-
return {
|
20
|
-
...config,
|
21
|
-
resolve: {
|
22
|
-
...config.resolve || {},
|
23
|
-
alias: {
|
24
|
-
...config.resolve?.alias || {},
|
25
|
-
'@payloadcms/db-postgres': aliasPath,
|
26
|
-
[_path.default.resolve(__dirname, './index')]: aliasPath
|
27
|
-
}
|
28
|
-
}
|
29
|
-
};
|
30
|
-
};
|
31
|
-
|
32
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy93ZWJwYWNrLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgV2VicGFjayB9IGZyb20gJ3BheWxvYWQvZGF0YWJhc2UnXG5cbmltcG9ydCBwYXRoIGZyb20gJ3BhdGgnXG5cbmV4cG9ydCBjb25zdCB3ZWJwYWNrOiBXZWJwYWNrID0gKGNvbmZpZykgPT4ge1xuICBjb25zdCBhbGlhc1BhdGggPSBwYXRoLnJlc29sdmUoX19kaXJuYW1lLCAnbW9jay5qcycpXG5cbiAgcmV0dXJuIHtcbiAgICAuLi5jb25maWcsXG4gICAgcmVzb2x2ZToge1xuICAgICAgLi4uKGNvbmZpZy5yZXNvbHZlIHx8IHt9KSxcbiAgICAgIGFsaWFzOiB7XG4gICAgICAgIC4uLihjb25maWcucmVzb2x2ZT8uYWxpYXMgfHwge30pLFxuICAgICAgICAnQHBheWxvYWRjbXMvZGItcG9zdGdyZXMnOiBhbGlhc1BhdGgsXG4gICAgICAgIFtwYXRoLnJlc29sdmUoX19kaXJuYW1lLCAnLi9pbmRleCcpXTogYWxpYXNQYXRoLFxuICAgICAgfSxcbiAgICB9LFxuICB9XG59XG4iXSwibmFtZXMiOlsid2VicGFjayIsImNvbmZpZyIsImFsaWFzUGF0aCIsInBhdGgiLCJyZXNvbHZlIiwiX19kaXJuYW1lIiwiYWxpYXMiXSwibWFwcGluZ3MiOiI7Ozs7K0JBSWFBOzs7ZUFBQUE7Ozs2REFGSTs7Ozs7O0FBRVYsTUFBTUEsVUFBbUIsQ0FBQ0M7SUFDL0IsTUFBTUMsWUFBWUMsYUFBSSxDQUF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