@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.
Files changed (177) hide show
  1. package/dist/connect.d.ts +3 -0
  2. package/dist/connect.d.ts.map +1 -0
  3. package/dist/connect.js +12 -12
  4. package/dist/create.d.ts +3 -0
  5. package/dist/create.d.ts.map +1 -0
  6. package/dist/create.js +2 -2
  7. package/dist/createGlobal.d.ts +5 -0
  8. package/dist/createGlobal.d.ts.map +1 -0
  9. package/dist/createGlobal.js +2 -2
  10. package/dist/createGlobalVersion.d.ts +6 -0
  11. package/dist/createGlobalVersion.d.ts.map +1 -0
  12. package/dist/createGlobalVersion.js +2 -2
  13. package/dist/createMigration.d.ts +3 -0
  14. package/dist/createMigration.d.ts.map +1 -0
  15. package/dist/createMigration.js +6 -6
  16. package/dist/createVersion.d.ts +5 -0
  17. package/dist/createVersion.d.ts.map +1 -0
  18. package/dist/createVersion.js +2 -2
  19. package/dist/deleteMany.d.ts +3 -0
  20. package/dist/deleteMany.d.ts.map +1 -0
  21. package/dist/deleteMany.js +2 -3
  22. package/dist/deleteOne.d.ts +3 -0
  23. package/dist/deleteOne.d.ts.map +1 -0
  24. package/dist/deleteOne.js +2 -2
  25. package/dist/deleteVersions.d.ts +3 -0
  26. package/dist/deleteVersions.d.ts.map +1 -0
  27. package/dist/deleteVersions.js +2 -2
  28. package/dist/destroy.d.ts +3 -0
  29. package/dist/destroy.d.ts.map +1 -0
  30. package/dist/extendViteConfig.d.ts +4 -0
  31. package/dist/extendViteConfig.d.ts.map +1 -0
  32. package/dist/extendViteConfig.js +38 -0
  33. package/dist/extendWebpackConfig.d.ts +4 -0
  34. package/dist/extendWebpackConfig.d.ts.map +1 -0
  35. package/dist/extendWebpackConfig.js +45 -0
  36. package/dist/find/buildFindManyArgs.d.ts +13 -0
  37. package/dist/find/buildFindManyArgs.d.ts.map +1 -0
  38. package/dist/find/chainMethods.d.ts +15 -0
  39. package/dist/find/chainMethods.d.ts.map +1 -0
  40. package/dist/find/findMany.d.ts +22 -0
  41. package/dist/find/findMany.d.ts.map +1 -0
  42. package/dist/find/findMany.js +2 -2
  43. package/dist/find/traverseFields.d.ts +16 -0
  44. package/dist/find/traverseFields.d.ts.map +1 -0
  45. package/dist/find.d.ts +3 -0
  46. package/dist/find.d.ts.map +1 -0
  47. package/dist/findGlobal.d.ts +3 -0
  48. package/dist/findGlobal.d.ts.map +1 -0
  49. package/dist/findGlobalVersions.d.ts +3 -0
  50. package/dist/findGlobalVersions.d.ts.map +1 -0
  51. package/dist/findOne.d.ts +5 -0
  52. package/dist/findOne.d.ts.map +1 -0
  53. package/dist/findOne.js +2 -2
  54. package/dist/findVersions.d.ts +3 -0
  55. package/dist/findVersions.d.ts.map +1 -0
  56. package/dist/index.d.ts +4 -0
  57. package/dist/index.d.ts.map +1 -0
  58. package/dist/index.js +8 -6
  59. package/dist/init.d.ts +3 -0
  60. package/dist/init.d.ts.map +1 -0
  61. package/dist/init.js +3 -4
  62. package/dist/migrate.d.ts +3 -0
  63. package/dist/migrate.d.ts.map +1 -0
  64. package/dist/migrate.js +4 -5
  65. package/dist/migrateStatus.d.ts +3 -0
  66. package/dist/migrateStatus.d.ts.map +1 -0
  67. package/dist/migrateStatus.js +2 -2
  68. package/dist/queries/buildAndOrConditions.d.ts +17 -0
  69. package/dist/queries/buildAndOrConditions.d.ts.map +1 -0
  70. package/dist/queries/buildQuery.d.ts +30 -0
  71. package/dist/queries/buildQuery.d.ts.map +1 -0
  72. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.d.ts +2 -0
  73. package/dist/queries/createJSONQuery/convertPathToJSONTraversal.d.ts.map +1 -0
  74. package/dist/queries/createJSONQuery/formatJSONPathSegment.d.ts +2 -0
  75. package/dist/queries/createJSONQuery/formatJSONPathSegment.d.ts.map +1 -0
  76. package/dist/queries/createJSONQuery/index.d.ts +10 -0
  77. package/dist/queries/createJSONQuery/index.d.ts.map +1 -0
  78. package/dist/queries/getTableColumnFromPath.d.ts +40 -0
  79. package/dist/queries/getTableColumnFromPath.d.ts.map +1 -0
  80. package/dist/queries/operatorMap.d.ts +18 -0
  81. package/dist/queries/operatorMap.d.ts.map +1 -0
  82. package/dist/queries/parseParams.d.ts +17 -0
  83. package/dist/queries/parseParams.d.ts.map +1 -0
  84. package/dist/queries/parseParams.js +1 -1
  85. package/dist/queries/sanitizeQueryValue.d.ts +12 -0
  86. package/dist/queries/sanitizeQueryValue.d.ts.map +1 -0
  87. package/dist/queryDrafts.d.ts +3 -0
  88. package/dist/queryDrafts.d.ts.map +1 -0
  89. package/dist/reference.d.ts +2 -0
  90. package/dist/reference.d.ts.map +1 -0
  91. package/dist/schema/build.d.ts +23 -0
  92. package/dist/schema/build.d.ts.map +1 -0
  93. package/dist/schema/build.js +6 -5
  94. package/dist/schema/createIndex.d.ts +11 -0
  95. package/dist/schema/createIndex.d.ts.map +1 -0
  96. package/dist/schema/createIndex.js +12 -3
  97. package/dist/schema/parentIDColumnMap.d.ts +7 -0
  98. package/dist/schema/parentIDColumnMap.d.ts.map +1 -0
  99. package/dist/schema/traverseFields.d.ts +33 -0
  100. package/dist/schema/traverseFields.d.ts.map +1 -0
  101. package/dist/schema/traverseFields.js +25 -9
  102. package/dist/schema/validateExistingBlockIsIdentical.d.ts +11 -0
  103. package/dist/schema/validateExistingBlockIsIdentical.d.ts.map +1 -0
  104. package/dist/transactions/beginTransaction.d.ts +3 -0
  105. package/dist/transactions/beginTransaction.d.ts.map +1 -0
  106. package/dist/transactions/beginTransaction.js +2 -2
  107. package/dist/transactions/commitTransaction.d.ts +3 -0
  108. package/dist/transactions/commitTransaction.d.ts.map +1 -0
  109. package/dist/transactions/rollbackTransaction.d.ts +3 -0
  110. package/dist/transactions/rollbackTransaction.d.ts.map +1 -0
  111. package/dist/transform/read/hasManyNumber.d.ts +10 -0
  112. package/dist/transform/read/hasManyNumber.d.ts.map +1 -0
  113. package/dist/transform/read/index.d.ts +12 -0
  114. package/dist/transform/read/index.d.ts.map +1 -0
  115. package/dist/transform/read/relationship.d.ts +10 -0
  116. package/dist/transform/read/relationship.d.ts.map +1 -0
  117. package/dist/transform/read/traverseFields.d.ts +44 -0
  118. package/dist/transform/read/traverseFields.d.ts.map +1 -0
  119. package/dist/transform/write/array.d.ts +22 -0
  120. package/dist/transform/write/array.d.ts.map +1 -0
  121. package/dist/transform/write/blocks.d.ts +21 -0
  122. package/dist/transform/write/blocks.d.ts.map +1 -0
  123. package/dist/transform/write/index.d.ts +11 -0
  124. package/dist/transform/write/index.d.ts.map +1 -0
  125. package/dist/transform/write/numbers.d.ts +8 -0
  126. package/dist/transform/write/numbers.d.ts.map +1 -0
  127. package/dist/transform/write/relationships.d.ts +10 -0
  128. package/dist/transform/write/relationships.d.ts.map +1 -0
  129. package/dist/transform/write/selects.d.ts +7 -0
  130. package/dist/transform/write/selects.d.ts.map +1 -0
  131. package/dist/transform/write/traverseFields.d.ts +46 -0
  132. package/dist/transform/write/traverseFields.d.ts.map +1 -0
  133. package/dist/transform/write/types.d.ts +41 -0
  134. package/dist/transform/write/types.d.ts.map +1 -0
  135. package/dist/types.d.ts +67 -0
  136. package/dist/types.d.ts.map +1 -0
  137. package/dist/update.d.ts +3 -0
  138. package/dist/update.d.ts.map +1 -0
  139. package/dist/update.js +2 -2
  140. package/dist/updateGlobal.d.ts +5 -0
  141. package/dist/updateGlobal.d.ts.map +1 -0
  142. package/dist/updateGlobal.js +2 -2
  143. package/dist/updateGlobalVersion.d.ts +6 -0
  144. package/dist/updateGlobalVersion.d.ts.map +1 -0
  145. package/dist/updateGlobalVersion.js +2 -2
  146. package/dist/updateVersion.d.ts +5 -0
  147. package/dist/updateVersion.d.ts.map +1 -0
  148. package/dist/updateVersion.js +2 -2
  149. package/dist/upsertRow/deleteExistingArrayRows.d.ts +10 -0
  150. package/dist/upsertRow/deleteExistingArrayRows.d.ts.map +1 -0
  151. package/dist/upsertRow/deleteExistingRowsByPath.d.ts +14 -0
  152. package/dist/upsertRow/deleteExistingRowsByPath.d.ts.map +1 -0
  153. package/dist/upsertRow/index.d.ts +4 -0
  154. package/dist/upsertRow/index.d.ts.map +1 -0
  155. package/dist/upsertRow/insertArrays.d.ts +13 -0
  156. package/dist/upsertRow/insertArrays.d.ts.map +1 -0
  157. package/dist/upsertRow/types.d.ts +26 -0
  158. package/dist/upsertRow/types.d.ts.map +1 -0
  159. package/dist/utilities/appendPrefixToKeys.d.ts +2 -0
  160. package/dist/utilities/appendPrefixToKeys.d.ts.map +1 -0
  161. package/dist/utilities/createBlocksMap.d.ts +5 -0
  162. package/dist/utilities/createBlocksMap.d.ts.map +1 -0
  163. package/dist/utilities/createMigrationTable.d.ts +3 -0
  164. package/dist/utilities/createMigrationTable.d.ts.map +1 -0
  165. package/dist/utilities/createRelationshipMap.d.ts +2 -0
  166. package/dist/utilities/createRelationshipMap.d.ts.map +1 -0
  167. package/dist/utilities/hasLocalesTable.d.ts +3 -0
  168. package/dist/utilities/hasLocalesTable.d.ts.map +1 -0
  169. package/dist/utilities/isArrayOfRows.d.ts +2 -0
  170. package/dist/utilities/isArrayOfRows.d.ts.map +1 -0
  171. package/dist/utilities/migrationTableExists.d.ts +3 -0
  172. package/dist/utilities/migrationTableExists.d.ts.map +1 -0
  173. package/mock.js +1 -0
  174. package/package.json +16 -17
  175. package/src/index.ts +93 -0
  176. package/dist/mock.js +0 -13
  177. package/dist/webpack.js +0 -30
@@ -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"}
@@ -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,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC9F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AAE1C,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import type { UpdateOne } from 'payload/database';
2
+ export declare const updateOne: UpdateOne;
3
+ //# sourceMappingURL=update.d.ts.map
@@ -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.db;
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy91cGRhdGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBVcGRhdGVPbmUgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuXG5pbXBvcnQgdG9TbmFrZUNhc2UgZnJvbSAndG8tc25ha2UtY2FzZSdcblxuaW1wb3J0IHR5cGUgeyBQb3N0Z3Jlc0FkYXB0ZXIgfSBmcm9tICcuL3R5cGVzJ1xuXG5pbXBvcnQgYnVpbGRRdWVyeSBmcm9tICcuL3F1ZXJpZXMvYnVpbGRRdWVyeSdcbmltcG9ydCB7IHVwc2VydFJvdyB9IGZyb20gJy4vdXBzZXJ0Um93J1xuXG5leHBvcnQgY29uc3QgdXBkYXRlT25lOiBVcGRhdGVPbmUgPSBhc3luYyBmdW5jdGlvbiB1cGRhdGVPbmUg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{ 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"}
@@ -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.db;
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy91cGRhdGVHbG9iYWwudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBVcGRhdGVHbG9iYWxBcmdzIH0gZnJvbSAncGF5bG9hZC9kYXRhYmFzZSdcbmltcG9ydCB0eXBlIHsgUGF5bG9hZFJlcXVlc3QsIFR5cGVXaXRoSUQgfSBmcm9tICdwYXlsb2FkL3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QUlJLGFBQWEsQ0FBQyxFQUFFRixNQUFNLElBQUksQ0FBQ0csT0FBTztJQUMvRCxNQUFNQyxlQUFlLElBQUksQ0FBQ0MsT0FBTyxDQUFDQyxPQUFPLENBQUNDLE1BQU0sQ0FBQ0MsSUFBSSxDQUFDLENBQUNELFNBQVdBLE9BQU9SLElBQUksS0FBS0E7SUFDbEYsTUFBTVUsWUFBWUMsSUFBQUEsb0JBQVcsRUFBQ1g7SUFFOUIsTUFBTVksaUJBQWlCLE1BQU1YLEdBQUdZLEtBQUssQ0FBQ0gsVUFBVSxDQUFDSSxTQUFTLENBQUMsQ0FBQztJQUU1RCxNQUFNQyxTQUFTLE1BQU1DLElBQUFBLG9CQUFTLEVBQUk7UUFDaEMsR0FBSUosaUJBQWlCO1lBQUVLLElBQUlMLGVBQWVLLEVBQUU7WUFBRUMsV0FBVztRQUFTLElBQUk7WUFBRUEsV0FBVztRQUFTLENBQUM7UUFDN0ZDLFNBQVMsSUFBSTtRQUNickI7UUFDQUc7UUFDQW1CLFFBQVFmLGFBQWFlLE1BQU07UUFDM0JWO0lBQ0Y7SUFFQSxPQUFPSztBQUNUIn0=
@@ -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.db;
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy91cGRhdGVHbG9iYWxWZXJzaW9uLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgVHlwZVdpdGhWZXJzaW9uIH0gZnJvbSAncGF5bG9hZC9kYXRhYmFzZSdcbmltcG9ydCB0eXBlIHsgVXBkYXRlR2xvYmFsVmVyc2lvbkFyZ3MgfSBmcm9tICdwYXlsb2FkL2RhdGFiYXNlJ1xuaW1wb3J0IHR5cGUgeyBQYXlsb2FkUmVxdWVzdCwgU2FuaXRpemVkR2xvYmFsQ29uZmlnLCBUeXBlV2l0aElEIH0gZnJvbSAncGF5bG9hZC90eXBlcydcblxuaW1wb3J0IHsgYnVpbGRWZXJzaW9uR2xvYmFsRmllbGRzIH0gZnJvbSAncGF5bG9hZC92ZXJzaW9ucydcbmltcG9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pEMUI7UUFDQXdCLFNBQVMsSUFBSTtRQUNiRyxNQUFNdkI7UUFDTkc7UUFDQWM7UUFDQU8sV0FBVztRQUNYVDtRQUNBZDtJQUNGO0lBRUEsT0FBT29CO0FBQ1QifQ==
@@ -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"}
@@ -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.db;
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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JQUU1QyxNQUFNLEVBQUVOLEtBQUssRUFBRSxHQUFHLE1BQU1nQixJQUFBQSxtQkFBVSxFQUFDO1FBQ2pDQyxTQUFTLElBQUk7UUFDYkg7UUFDQWpCO1FBQ0FlO1FBQ0FaLE9BQU9VO0lBQ1Q7SUFFQSxNQUFNUSxTQUFTLE1BQU1DLElBQUFBLG9CQUFTLEVBQXFCO1FBQ2pEeEI7UUFDQXNCLFNBQVMsSUFBSTtRQUNiRyxNQUFNckI7UUFDTkc7UUFDQVk7UUFDQU8sV0FBVztRQUNYVDtRQUNBWjtJQUNGO0lBRUEsT0FBT2tCO0FBQ1QifQ==
@@ -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,2 @@
1
+ export declare const appendPrefixToObjectKeys: <T>(obj: Record<string, unknown>, prefix: string) => T;
2
+ //# sourceMappingURL=appendPrefixToKeys.d.ts.map
@@ -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,5 @@
1
+ export type BlocksMap = {
2
+ [path: string]: Record<string, unknown>[];
3
+ };
4
+ export declare const createBlocksMap: (data: Record<string, unknown>) => BlocksMap;
5
+ //# sourceMappingURL=createBlocksMap.d.ts.map
@@ -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,3 @@
1
+ import type { DrizzleDB } from '../types';
2
+ export declare const createMigrationTable: (db: DrizzleDB) => Promise<void>;
3
+ //# sourceMappingURL=createMigrationTable.d.ts.map
@@ -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,2 @@
1
+ export declare const createPathMap: (rows: unknown) => Record<string, Record<string, unknown>[]>;
2
+ //# sourceMappingURL=createRelationshipMap.d.ts.map
@@ -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,3 @@
1
+ import type { Field } from 'payload/types';
2
+ export declare const hasLocalesTable: (fields: Field[]) => boolean;
3
+ //# sourceMappingURL=hasLocalesTable.d.ts.map
@@ -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,2 @@
1
+ export declare function isArrayOfRows(data: unknown): data is Record<string, unknown>[];
2
+ //# sourceMappingURL=isArrayOfRows.d.ts.map
@@ -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,3 @@
1
+ import type { DrizzleDB } from '../types';
2
+ export declare const migrationTableExists: (db: DrizzleDB) => Promise<boolean>;
3
+ //# sourceMappingURL=migrationTableExists.d.ts.map
@@ -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.0",
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",
@@ -10,13 +10,8 @@
10
10
  "name": "Payload",
11
11
  "url": "https://payloadcms.com"
12
12
  },
13
- "main": "./src/index.ts",
14
- "types": "./src/index.ts",
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,25 @@
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
- "better-sqlite3": "^8.5.0",
34
- "payload": "workspace:*"
27
+ "payload": "2.0.0-beta.10",
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
- "main": "./dist/index.js",
41
- "registry": "https://registry.npmjs.org/",
42
- "types": "./dist/index.d.ts"
34
+ "registry": "https://registry.npmjs.org/"
43
35
  },
44
36
  "files": [
45
- "dist"
46
- ]
47
- }
37
+ "dist",
38
+ "mock.js"
39
+ ],
40
+ "scripts": {
41
+ "build": "pnpm build:swc && pnpm build:types",
42
+ "build:swc": "swc ./src -d ./dist --config-file .swcrc",
43
+ "build:types": "tsc --emitDeclarationOnly --outDir dist",
44
+ "clean": "rimraf {dist,*.tsbuildinfo}"
45
+ }
46
+ }