@payloadcms/drizzle 4.0.0-internal.543da65 → 4.0.0-internal.567a487
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/count.d.ts.map +1 -1
- package/dist/count.js +8 -2
- package/dist/count.js.map +1 -1
- package/dist/countVersions.d.ts.map +1 -1
- package/dist/countVersions.js +11 -3
- package/dist/countVersions.js.map +1 -1
- package/dist/createGlobalVersion.d.ts.map +1 -1
- package/dist/createGlobalVersion.js +15 -2
- package/dist/createGlobalVersion.js.map +1 -1
- package/dist/createTableName.d.ts.map +1 -1
- package/dist/createTableName.js +2 -7
- package/dist/createTableName.js.map +1 -1
- package/dist/createVersion.d.ts.map +1 -1
- package/dist/createVersion.js +12 -1
- package/dist/createVersion.js.map +1 -1
- package/dist/deleteBranchGlobal.d.ts +10 -0
- package/dist/deleteBranchGlobal.d.ts.map +1 -0
- package/dist/deleteBranchGlobal.js +27 -0
- package/dist/deleteBranchGlobal.js.map +1 -0
- package/dist/deleteOne.d.ts.map +1 -1
- package/dist/deleteOne.js +18 -1
- package/dist/deleteOne.js.map +1 -1
- package/dist/find/buildFindManyArgs.d.ts +3 -2
- package/dist/find/buildFindManyArgs.d.ts.map +1 -1
- package/dist/find/buildFindManyArgs.js +2 -1
- package/dist/find/buildFindManyArgs.js.map +1 -1
- package/dist/find/findMany.d.ts.map +1 -1
- package/dist/find/findMany.js +1 -0
- package/dist/find/findMany.js.map +1 -1
- package/dist/find/traverseFields.d.ts +3 -2
- package/dist/find/traverseFields.d.ts.map +1 -1
- package/dist/find/traverseFields.js +25 -2
- package/dist/find/traverseFields.js.map +1 -1
- package/dist/find.d.ts.map +1 -1
- package/dist/find.js +23 -4
- package/dist/find.js.map +1 -1
- package/dist/findDistinct.d.ts.map +1 -1
- package/dist/findDistinct.js +9 -2
- package/dist/findDistinct.js.map +1 -1
- package/dist/findGlobal.d.ts.map +1 -1
- package/dist/findGlobal.js +16 -4
- package/dist/findGlobal.js.map +1 -1
- package/dist/findGlobalVersions.js +8 -3
- package/dist/findGlobalVersions.js.map +1 -1
- package/dist/findOne.d.ts +1 -1
- package/dist/findOne.d.ts.map +1 -1
- package/dist/findOne.js +21 -3
- package/dist/findOne.js.map +1 -1
- package/dist/findVersions.d.ts.map +1 -1
- package/dist/findVersions.js +20 -5
- package/dist/findVersions.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/postgres/createDatabase.d.ts.map +1 -1
- package/dist/postgres/createExtensions.d.ts.map +1 -1
- package/dist/postgres/createJSONQuery/index.d.ts.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/fetchAndResave/index.d.ts.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/fetchAndResave/traverseFields.d.ts.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/groupUpSQLStatements.d.ts.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/index.d.ts.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/migrateRelationships.d.ts.map +1 -1
- package/dist/postgres/predefinedMigrations/v2-v3/traverseFields.d.ts.map +1 -1
- package/dist/postgres/schema/buildDrizzleTable.d.ts.map +1 -1
- package/dist/postgres/schema/geometryColumn.d.ts +2 -2
- package/dist/postgres/schema/geometryColumn.d.ts.map +1 -1
- package/dist/queries/addJoinTable.d.ts +1 -1
- package/dist/queries/addJoinTable.d.ts.map +1 -1
- package/dist/queries/buildOrderBy.d.ts +1 -1
- package/dist/queries/buildOrderBy.d.ts.map +1 -1
- package/dist/queries/buildQuery.d.ts.map +1 -1
- package/dist/queries/getTableAlias.d.ts.map +1 -1
- package/dist/queries/getTableColumnFromPath.d.ts.map +1 -1
- package/dist/queries/sanitizeQueryValue.d.ts.map +1 -1
- package/dist/queries/selectDistinct.d.ts.map +1 -1
- package/dist/queryDrafts.d.ts.map +1 -1
- package/dist/queryDrafts.js +15 -4
- package/dist/queryDrafts.js.map +1 -1
- package/dist/schema/build.d.ts.map +1 -1
- package/dist/schema/build.js +5 -4
- package/dist/schema/build.js.map +1 -1
- package/dist/schema/buildDrizzleRelations.d.ts.map +1 -1
- package/dist/schema/buildRawSchema.d.ts.map +1 -1
- package/dist/schema/buildRawSchema.spec.js +230 -0
- package/dist/schema/buildRawSchema.spec.js.map +1 -0
- package/dist/schema/idToUUID.d.ts.map +1 -1
- package/dist/schema/traverseFields.d.ts.map +1 -1
- package/dist/schema/traverseFields.js +5 -5
- package/dist/schema/traverseFields.js.map +1 -1
- package/dist/schema/withDefault.d.ts.map +1 -1
- package/dist/sqlite/createJSONQuery/convertPathToJSONTraversal.d.ts.map +1 -1
- package/dist/sqlite/createJSONQuery/index.d.ts.map +1 -1
- package/dist/transform/read/hasManyNumber.d.ts.map +1 -1
- package/dist/transform/read/hasManyText.d.ts.map +1 -1
- package/dist/transform/read/index.d.ts.map +1 -1
- package/dist/transform/read/relationship.d.ts.map +1 -1
- package/dist/transform/read/traverseFields.d.ts.map +1 -1
- package/dist/transform/write/array.d.ts.map +1 -1
- package/dist/transform/write/blocks.d.ts.map +1 -1
- package/dist/transform/write/index.d.ts.map +1 -1
- package/dist/transform/write/numbers.d.ts.map +1 -1
- package/dist/transform/write/relationships.d.ts.map +1 -1
- package/dist/transform/write/selects.d.ts.map +1 -1
- package/dist/transform/write/texts.d.ts.map +1 -1
- package/dist/transform/write/traverseFields.d.ts.map +1 -1
- package/dist/updateGlobal.d.ts +1 -1
- package/dist/updateGlobal.d.ts.map +1 -1
- package/dist/updateGlobal.js +30 -3
- package/dist/updateGlobal.js.map +1 -1
- package/dist/updateJobs.d.ts.map +1 -1
- package/dist/updateJobs.js +37 -0
- package/dist/updateJobs.js.map +1 -1
- package/dist/updateOne.d.ts.map +1 -1
- package/dist/updateOne.js +24 -3
- package/dist/updateOne.js.map +1 -1
- package/dist/upsertRow/deleteExistingArrayRows.d.ts.map +1 -1
- package/dist/upsertRow/deleteExistingRowsByPath.d.ts.map +1 -1
- package/dist/upsertRow/handleUpsertError.d.ts.map +1 -1
- package/dist/upsertRow/index.d.ts.map +1 -1
- package/dist/upsertRow/insertArrays.d.ts.map +1 -1
- package/dist/upsertRow/shouldUseOptimizedUpsertRow.d.ts.map +1 -1
- package/dist/utilities/appendPrefixToKeys.d.ts.map +1 -1
- package/dist/utilities/blocksToJsonMigrator.d.ts.map +1 -1
- package/dist/utilities/buildCreateMigration.d.ts.map +1 -1
- package/dist/utilities/buildForeignKeyName.d.ts.map +1 -1
- package/dist/utilities/buildIndexName.d.ts.map +1 -1
- package/dist/utilities/createBlocksMap.d.ts.map +1 -1
- package/dist/utilities/createRelationshipMap.d.ts.map +1 -1
- package/dist/utilities/createSchemaGenerator.d.ts.map +1 -1
- package/dist/utilities/escapeSQLValue.d.ts.map +1 -1
- package/dist/utilities/executeSchemaHooks.d.ts.map +1 -1
- package/dist/utilities/extendDrizzleTable.d.ts.map +1 -1
- package/dist/utilities/getArrayRelationName.d.ts.map +1 -1
- package/dist/utilities/getCollectionIdType.d.ts.map +1 -1
- package/dist/utilities/getMigrationTemplate.d.ts.map +1 -1
- package/dist/utilities/getNameFromDrizzleTable.d.ts.map +1 -1
- package/dist/utilities/getPrimaryDb.d.ts +1 -1
- package/dist/utilities/getPrimaryDb.d.ts.map +1 -1
- package/dist/utilities/getTransaction.d.ts +1 -1
- package/dist/utilities/getTransaction.d.ts.map +1 -1
- package/dist/utilities/hasLocalesTable.d.ts.map +1 -1
- package/dist/utilities/isPolymorphicRelationship.d.ts.map +1 -1
- package/dist/utilities/isUUIDType.d.ts.map +1 -1
- package/dist/utilities/json.d.ts.map +1 -1
- package/dist/utilities/migrationTableExists.d.ts.map +1 -1
- package/dist/utilities/parseError.d.ts.map +1 -1
- package/dist/utilities/pushDevSchema.d.ts.map +1 -1
- package/dist/utilities/rawConstraint.d.ts.map +1 -1
- package/dist/utilities/sanitizePathSegment.d.ts.map +1 -1
- package/dist/utilities/validateExistingBlockIsIdentical.d.ts +1 -5
- package/dist/utilities/validateExistingBlockIsIdentical.d.ts.map +1 -1
- package/dist/utilities/validateExistingBlockIsIdentical.js.map +1 -1
- package/dist/utilities/validateIdentifierLength.d.ts +7 -0
- package/dist/utilities/validateIdentifierLength.d.ts.map +1 -0
- package/dist/utilities/validateIdentifierLength.js +14 -0
- package/dist/utilities/validateIdentifierLength.js.map +1 -0
- package/dist/utilities/validateIdentifierLength.spec.js +19 -0
- package/dist/utilities/validateIdentifierLength.spec.js.map +1 -0
- package/package.json +3 -3
package/dist/updateOne.js
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
|
+
import { applyBranchIDProjection, resolveBranchRowID, withBranchIDSelect } from 'payload';
|
|
1
2
|
import toSnakeCase from 'to-snake-case';
|
|
2
3
|
import { buildQuery } from './queries/buildQuery.js';
|
|
3
4
|
import { selectDistinct } from './queries/selectDistinct.js';
|
|
4
5
|
import { upsertRow } from './upsertRow/index.js';
|
|
5
6
|
import { getPrimaryDb } from './utilities/getPrimaryDb.js';
|
|
6
7
|
import { getTransaction } from './utilities/getTransaction.js';
|
|
7
|
-
export const updateOne = async function updateOne({ id, collection: collectionSlug, data, joins: joinQuery, locale, options = {
|
|
8
|
+
export const updateOne = async function updateOne({ id, branch, collection: collectionSlug, data, joins: joinQuery, locale, options = {
|
|
8
9
|
upsert: false
|
|
9
10
|
}, req, returning, select, where: whereArg }) {
|
|
10
11
|
const collection = this.payload.collections[collectionSlug].config;
|
|
11
12
|
const tableName = this.tableNameMap.get(toSnakeCase(collection.slug));
|
|
12
|
-
let idToUpdate = id
|
|
13
|
+
let idToUpdate = id === undefined || id === null ? id : await resolveBranchRowID({
|
|
14
|
+
id,
|
|
15
|
+
branch,
|
|
16
|
+
collectionSlug,
|
|
17
|
+
req
|
|
18
|
+
});
|
|
13
19
|
const db = getPrimaryDb(this, await getTransaction(this, req));
|
|
14
20
|
if (!idToUpdate) {
|
|
15
21
|
const { joins, selectFields, where } = buildQuery({
|
|
@@ -57,12 +63,27 @@ export const updateOne = async function updateOne({ id, collection: collectionSl
|
|
|
57
63
|
joinQuery,
|
|
58
64
|
operation: 'update',
|
|
59
65
|
req,
|
|
60
|
-
select
|
|
66
|
+
select: withBranchIDSelect({
|
|
67
|
+
branch,
|
|
68
|
+
collectionSlug,
|
|
69
|
+
req,
|
|
70
|
+
select
|
|
71
|
+
}),
|
|
61
72
|
tableName
|
|
62
73
|
});
|
|
63
74
|
if (returning === false) {
|
|
64
75
|
return null;
|
|
65
76
|
}
|
|
77
|
+
// The row written on a branch is the shadow row, so the document it returns
|
|
78
|
+
// carries that row's primary key rather than the document's canonical ID.
|
|
79
|
+
applyBranchIDProjection({
|
|
80
|
+
branch,
|
|
81
|
+
collectionSlug,
|
|
82
|
+
docs: [
|
|
83
|
+
result
|
|
84
|
+
],
|
|
85
|
+
req
|
|
86
|
+
});
|
|
66
87
|
return result;
|
|
67
88
|
};
|
|
68
89
|
|
package/dist/updateOne.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/updateOne.ts"],"sourcesContent":["import type { LibSQLDatabase } from 'drizzle-orm/libsql'\nimport type { UpdateOne } from 'payload'\n\nimport toSnakeCase from 'to-snake-case'\n\nimport type { DrizzleAdapter } from './types.js'\n\nimport { buildQuery } from './queries/buildQuery.js'\nimport { selectDistinct } from './queries/selectDistinct.js'\nimport { upsertRow } from './upsertRow/index.js'\nimport { getPrimaryDb } from './utilities/getPrimaryDb.js'\nimport { getTransaction } from './utilities/getTransaction.js'\n\nexport const updateOne: UpdateOne = async function updateOne(\n this: DrizzleAdapter,\n {\n id,\n collection: collectionSlug,\n data,\n joins: joinQuery,\n locale,\n options = { upsert: false },\n req,\n returning,\n select,\n where: whereArg,\n },\n) {\n const collection = this.payload.collections[collectionSlug].config\n const tableName = this.tableNameMap.get(toSnakeCase(collection.slug))\n let idToUpdate
|
|
1
|
+
{"version":3,"sources":["../src/updateOne.ts"],"sourcesContent":["import type { LibSQLDatabase } from 'drizzle-orm/libsql'\nimport type { UpdateOne } from 'payload'\n\nimport { applyBranchIDProjection, resolveBranchRowID, withBranchIDSelect } from 'payload'\nimport toSnakeCase from 'to-snake-case'\n\nimport type { DrizzleAdapter } from './types.js'\n\nimport { buildQuery } from './queries/buildQuery.js'\nimport { selectDistinct } from './queries/selectDistinct.js'\nimport { upsertRow } from './upsertRow/index.js'\nimport { getPrimaryDb } from './utilities/getPrimaryDb.js'\nimport { getTransaction } from './utilities/getTransaction.js'\n\nexport const updateOne: UpdateOne = async function updateOne(\n this: DrizzleAdapter,\n {\n id,\n branch,\n collection: collectionSlug,\n data,\n joins: joinQuery,\n locale,\n options = { upsert: false },\n req,\n returning,\n select,\n where: whereArg,\n },\n) {\n const collection = this.payload.collections[collectionSlug].config\n const tableName = this.tableNameMap.get(toSnakeCase(collection.slug))\n let idToUpdate =\n id === undefined || id === null\n ? id\n : await resolveBranchRowID({ id, branch, collectionSlug, req })\n\n const db = getPrimaryDb(this, await getTransaction(this, req))\n\n if (!idToUpdate) {\n const { joins, selectFields, where } = buildQuery({\n adapter: this,\n fields: collection.flattenedFields,\n locale,\n tableName,\n where: whereArg,\n })\n\n // selectDistinct will only return if there are joins\n const selectDistinctResult = await selectDistinct({\n adapter: this,\n db,\n joins,\n query: ({ query }) => query.limit(1),\n selectFields,\n tableName,\n where,\n })\n\n if (selectDistinctResult?.[0]?.id) {\n idToUpdate = selectDistinctResult?.[0]?.id\n // If id wasn't passed but `where` without any joins, retrieve it with findFirst\n } else if (whereArg && !joins.length) {\n const table = this.tables[tableName]\n\n const docsToUpdate = await (db as LibSQLDatabase)\n .select({\n id: table.id,\n })\n .from(table)\n .where(where)\n .limit(1)\n idToUpdate = docsToUpdate?.[0]?.id\n }\n }\n\n if (!idToUpdate && !options.upsert) {\n // TODO: In 4.0, if returning === false, we should differentiate between:\n // - No document found to update\n // - Document found, but returning === false\n return null\n }\n\n const result = await upsertRow({\n id: idToUpdate,\n adapter: this,\n collectionSlug,\n data,\n db,\n fields: collection.flattenedFields,\n ignoreResult: returning === false,\n joinQuery,\n operation: 'update',\n req,\n select: withBranchIDSelect({ branch, collectionSlug, req, select }),\n tableName,\n })\n\n if (returning === false) {\n return null\n }\n\n // The row written on a branch is the shadow row, so the document it returns\n // carries that row's primary key rather than the document's canonical ID.\n applyBranchIDProjection({\n branch,\n collectionSlug,\n docs: [result as Record<string, unknown>],\n req,\n })\n\n return result\n}\n"],"names":["applyBranchIDProjection","resolveBranchRowID","withBranchIDSelect","toSnakeCase","buildQuery","selectDistinct","upsertRow","getPrimaryDb","getTransaction","updateOne","id","branch","collection","collectionSlug","data","joins","joinQuery","locale","options","upsert","req","returning","select","where","whereArg","payload","collections","config","tableName","tableNameMap","get","slug","idToUpdate","undefined","db","selectFields","adapter","fields","flattenedFields","selectDistinctResult","query","limit","length","table","tables","docsToUpdate","from","result","ignoreResult","operation","docs"],"mappings":"AAGA,SAASA,uBAAuB,EAAEC,kBAAkB,EAAEC,kBAAkB,QAAQ,UAAS;AACzF,OAAOC,iBAAiB,gBAAe;AAIvC,SAASC,UAAU,QAAQ,0BAAyB;AACpD,SAASC,cAAc,QAAQ,8BAA6B;AAC5D,SAASC,SAAS,QAAQ,uBAAsB;AAChD,SAASC,YAAY,QAAQ,8BAA6B;AAC1D,SAASC,cAAc,QAAQ,gCAA+B;AAE9D,OAAO,MAAMC,YAAuB,eAAeA,UAEjD,EACEC,EAAE,EACFC,MAAM,EACNC,YAAYC,cAAc,EAC1BC,IAAI,EACJC,OAAOC,SAAS,EAChBC,MAAM,EACNC,UAAU;IAAEC,QAAQ;AAAM,CAAC,EAC3BC,GAAG,EACHC,SAAS,EACTC,MAAM,EACNC,OAAOC,QAAQ,EAChB;IAED,MAAMZ,aAAa,IAAI,CAACa,OAAO,CAACC,WAAW,CAACb,eAAe,CAACc,MAAM;IAClE,MAAMC,YAAY,IAAI,CAACC,YAAY,CAACC,GAAG,CAAC3B,YAAYS,WAAWmB,IAAI;IACnE,IAAIC,aACFtB,OAAOuB,aAAavB,OAAO,OACvBA,KACA,MAAMT,mBAAmB;QAAES;QAAIC;QAAQE;QAAgBO;IAAI;IAEjE,MAAMc,KAAK3B,aAAa,IAAI,EAAE,MAAMC,eAAe,IAAI,EAAEY;IAEzD,IAAI,CAACY,YAAY;QACf,MAAM,EAAEjB,KAAK,EAAEoB,YAAY,EAAEZ,KAAK,EAAE,GAAGnB,WAAW;YAChDgC,SAAS,IAAI;YACbC,QAAQzB,WAAW0B,eAAe;YAClCrB;YACAW;YACAL,OAAOC;QACT;QAEA,qDAAqD;QACrD,MAAMe,uBAAuB,MAAMlC,eAAe;YAChD+B,SAAS,IAAI;YACbF;YACAnB;YACAyB,OAAO,CAAC,EAAEA,KAAK,EAAE,GAAKA,MAAMC,KAAK,CAAC;YAClCN;YACAP;YACAL;QACF;QAEA,IAAIgB,sBAAsB,CAAC,EAAE,EAAE7B,IAAI;YACjCsB,aAAaO,sBAAsB,CAAC,EAAE,EAAE7B;QACxC,gFAAgF;QAClF,OAAO,IAAIc,YAAY,CAACT,MAAM2B,MAAM,EAAE;YACpC,MAAMC,QAAQ,IAAI,CAACC,MAAM,CAAChB,UAAU;YAEpC,MAAMiB,eAAe,MAAM,AAACX,GACzBZ,MAAM,CAAC;gBACNZ,IAAIiC,MAAMjC,EAAE;YACd,GACCoC,IAAI,CAACH,OACLpB,KAAK,CAACA,OACNkB,KAAK,CAAC;YACTT,aAAaa,cAAc,CAAC,EAAE,EAAEnC;QAClC;IACF;IAEA,IAAI,CAACsB,cAAc,CAACd,QAAQC,MAAM,EAAE;QAClC,yEAAyE;QACzE,gCAAgC;QAChC,4CAA4C;QAC5C,OAAO;IACT;IAEA,MAAM4B,SAAS,MAAMzC,UAAU;QAC7BI,IAAIsB;QACJI,SAAS,IAAI;QACbvB;QACAC;QACAoB;QACAG,QAAQzB,WAAW0B,eAAe;QAClCU,cAAc3B,cAAc;QAC5BL;QACAiC,WAAW;QACX7B;QACAE,QAAQpB,mBAAmB;YAAES;YAAQE;YAAgBO;YAAKE;QAAO;QACjEM;IACF;IAEA,IAAIP,cAAc,OAAO;QACvB,OAAO;IACT;IAEA,4EAA4E;IAC5E,0EAA0E;IAC1ErB,wBAAwB;QACtBW;QACAE;QACAqC,MAAM;YAACH;SAAkC;QACzC3B;IACF;IAEA,OAAO2B;AACT,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteExistingArrayRows.d.ts","sourceRoot":"","sources":["../../src/upsertRow/deleteExistingArrayRows.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErE,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,cAAc,CAAA;IACvB,EAAE,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,kBAAkB,CAAA;IAClD,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"deleteExistingArrayRows.d.ts","sourceRoot":"","sources":["../../src/upsertRow/deleteExistingArrayRows.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErE,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,cAAc,CAAA;IACvB,EAAE,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,kBAAkB,CAAA;IAClD,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,uBAAuB,0CAKjC,IAAI,KAAG,OAAO,CAAC,IAAI,CAUrB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteExistingRowsByPath.d.ts","sourceRoot":"","sources":["../../src/upsertRow/deleteExistingRowsByPath.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErE,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,cAAc,CAAA;IACvB,EAAE,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,kBAAkB,CAAA;IAClD,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,
|
|
1
|
+
{"version":3,"file":"deleteExistingRowsByPath.d.ts","sourceRoot":"","sources":["../../src/upsertRow/deleteExistingRowsByPath.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErE,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,cAAc,CAAA;IACvB,EAAE,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,kBAAkB,CAAA;IAClD,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,OAAO,CAAC,IAAI,CA4CrB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleUpsertError.d.ts","sourceRoot":"","sources":["../../src/upsertRow/handleUpsertError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAI7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,KAAK,qBAAqB,GAAG;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,EAAE,OAAO,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,GAAG,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;IAC7B,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"handleUpsertError.d.ts","sourceRoot":"","sources":["../../src/upsertRow/handleUpsertError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAI7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,KAAK,qBAAqB,GAAG;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,EAAE,OAAO,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,GAAG,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;IAC7B,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,qFAQ3B,qBAAqB,KAAG,KAkE1B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/upsertRow/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAKzC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAqBtC;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAU,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/upsertRow/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAKzC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAqBtC;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAU,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,+KAqB3E,IAAI,KAAG,OAAO,CAAC,CAAC,CAotBlB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertArrays.d.ts","sourceRoot":"","sources":["../../src/upsertRow/insertArrays.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErE,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,cAAc,CAAA;IACvB,MAAM,EAAE;QACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;KACxC,EAAE,CAAA;IACH,EAAE,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,kBAAkB,CAAA;IAClD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;CAC1C,CAAA;AAYD,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"insertArrays.d.ts","sourceRoot":"","sources":["../../src/upsertRow/insertArrays.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErE,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,cAAc,CAAA;IACvB,MAAM,EAAE;QACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;KACxC,EAAE,CAAA;IACH,EAAE,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,kBAAkB,CAAA;IAClD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;CAC1C,CAAA;AAYD,eAAO,MAAM,YAAY,kDAMtB,IAAI,KAAG,OAAO,CAAC,IAAI,CAiGrB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shouldUseOptimizedUpsertRow.d.ts","sourceRoot":"","sources":["../../src/upsertRow/shouldUseOptimizedUpsertRow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;;GAGG;AACH,eAAO,MAAM,2BAA2B,
|
|
1
|
+
{"version":3,"file":"shouldUseOptimizedUpsertRow.d.ts","sourceRoot":"","sources":["../../src/upsertRow/shouldUseOptimizedUpsertRow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;;GAGG;AACH,eAAO,MAAM,2BAA2B,sBAGrC;IACD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,MAAM,EAAE,cAAc,EAAE,CAAA;CACzB,QA8EA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appendPrefixToKeys.d.ts","sourceRoot":"","sources":["../../src/utilities/appendPrefixToKeys.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,GAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"appendPrefixToKeys.d.ts","sourceRoot":"","sources":["../../src/utilities/appendPrefixToKeys.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,GAAI,CAAC,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,MAAM,KAAG,CAI9E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocksToJsonMigrator.d.ts","sourceRoot":"","sources":["../../src/utilities/blocksToJsonMigrator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EAExB,OAAO,EAGR,MAAM,SAAS,CAAA;AAchB,OAAO,KAAK,EAGV,oBAAoB,EACpB,cAAc,EACf,MAAM,aAAa,CAAA;AA8rBpB,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"blocksToJsonMigrator.d.ts","sourceRoot":"","sources":["../../src/utilities/blocksToJsonMigrator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EAExB,OAAO,EAGR,MAAM,SAAS,CAAA;AAchB,OAAO,KAAK,EAGV,oBAAoB,EACpB,cAAc,EACf,MAAM,aAAa,CAAA;AA8rBpB,eAAO,MAAM,0BAA0B,oDAIpC;IACD,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB,kBAAkB,EAAE,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,EAAE,CAAA;KAAE,KAAK,MAAM,CAAA;CACnF,KAAG,oBAEH,CAAA;AAED,eAAO,MAAM,uBAAuB,YAAa,OAAO,KAAG,oBAQ1D,CAAA;AAED,eAAO,MAAM,2CAA2C,qBAErD;IACD,WAAW,EAAE,MAAM,CAAA;CACpB,KAAG,wBAoCH,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildCreateMigration.d.ts","sourceRoot":"","sources":["../../src/utilities/buildCreateMigration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAW,MAAM,SAAS,CAAA;AAWvD,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"buildCreateMigration.d.ts","sourceRoot":"","sources":["../../src/utilities/buildCreateMigration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAW,MAAM,SAAS,CAAA;AAWvD,eAAO,MAAM,oBAAoB,qDAI9B;IACD,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,kBAAkB,EAAE,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,EAAE,CAAA;KAAE,KAAK,MAAM,CAAA;CACnF,KAAG,eA6IH,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildForeignKeyName.d.ts","sourceRoot":"","sources":["../../src/utilities/buildForeignKeyName.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"buildForeignKeyName.d.ts","sourceRoot":"","sources":["../../src/utilities/buildForeignKeyName.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,eAAO,MAAM,mBAAmB,+BAI7B;IACD,OAAO,EAAE,cAAc,CAAA;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,KAAG,MAkBH,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildIndexName.d.ts","sourceRoot":"","sources":["../../src/utilities/buildIndexName.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"buildIndexName.d.ts","sourceRoot":"","sources":["../../src/utilities/buildIndexName.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,eAAO,MAAM,cAAc,6CAKxB;IACD,OAAO,EAAE,cAAc,CAAA;IACvB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,KAAG,MAmBH,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createBlocksMap.d.ts","sourceRoot":"","sources":["../../src/utilities/createBlocksMap.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CAC1C,CAAA;AAED,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"createBlocksMap.d.ts","sourceRoot":"","sources":["../../src/utilities/createBlocksMap.ts"],"names":[],"mappings":"AAAA,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,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,SAyC/D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRelationshipMap.d.ts","sourceRoot":"","sources":["../../src/utilities/createRelationshipMap.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"createRelationshipMap.d.ts","sourceRoot":"","sources":["../../src/utilities/createRelationshipMap.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,SAAU,OAAO,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAqBrF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSchemaGenerator.d.ts","sourceRoot":"","sources":["../../src/utilities/createSchemaGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAM7C,OAAO,KAAK,EAAE,qBAAqB,EAAkB,MAAM,aAAa,CAAA;AAkCxE,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"createSchemaGenerator.d.ts","sourceRoot":"","sources":["../../src/utilities/createSchemaGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAM7C,OAAO,KAAK,EAAE,qBAAqB,EAAkB,MAAM,aAAa,CAAA;AAkCxE,eAAO,MAAM,qBAAqB,4GAO/B;IACD,qBAAqB,EAAE,qBAAqB,CAAA;IAC5C,iBAAiB,EAAE,MAAM,CAAA;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;CACpB,KAAG,cAiTH,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escapeSQLValue.d.ts","sourceRoot":"","sources":["../../src/utilities/escapeSQLValue.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,QAAmB,CAAA;AAEjD,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"escapeSQLValue.d.ts","sourceRoot":"","sources":["../../src/utilities/escapeSQLValue.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,QAAmB,CAAA;AAEjD,eAAO,MAAM,cAAc,UAAW,OAAO,KAAG,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,MAoBzE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executeSchemaHooks.d.ts","sourceRoot":"","sources":["../../src/utilities/executeSchemaHooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D,KAAK,cAAc,GAAG;IACpB,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAA;IAC/B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC9B,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;CACjC,CAAA;AAED,KAAK,OAAO,GAAG;IACb,eAAe,EAAE,kBAAkB,EAAE,CAAA;IACrC,gBAAgB,EAAE,kBAAkB,EAAE,CAAA;CACvC,GAAG,cAAc,CAAA;AAElB,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,WAAW,EAAE,OAAO,kBAAkB,CAAA;IACtC,MAAM,EAAE,cAAc,CAAA;CACvB,CAAA;AAED,KAAK,kBAAkB,GAAG,CAAC,IAAI,EAAE,sBAAsB,KAAK,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;AAEpG,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,iBAAiB,GAAG,kBAAkB,CAAA;CAC7C,CAAA;AAED,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"executeSchemaHooks.d.ts","sourceRoot":"","sources":["../../src/utilities/executeSchemaHooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D,KAAK,cAAc,GAAG;IACpB,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAA;IAC/B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC9B,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;CACjC,CAAA;AAED,KAAK,OAAO,GAAG;IACb,eAAe,EAAE,kBAAkB,EAAE,CAAA;IACrC,gBAAgB,EAAE,kBAAkB,EAAE,CAAA;CACvC,GAAG,cAAc,CAAA;AAElB,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,WAAW,EAAE,OAAO,kBAAkB,CAAA;IACtC,MAAM,EAAE,cAAc,CAAA;CACvB,CAAA;AAED,KAAK,kBAAkB,GAAG,CAAC,IAAI,EAAE,sBAAsB,KAAK,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;AAEpG,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,iBAAiB,GAAG,kBAAkB,CAAA;CAC7C,CAAA;AAED,eAAO,MAAM,kBAAkB,sBAA6B,IAAI,KAAG,OAAO,CAAC,IAAI,CAkB9E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extendDrizzleTable.d.ts","sourceRoot":"","sources":["../../src/utilities/extendDrizzleTable.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEpD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAWnC,KAAK,IAAI,GAAG;IACV,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAA;IAChD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,CAAA;IACnD,KAAK,EAAE,KAAK,CAAA;CACb,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"extendDrizzleTable.d.ts","sourceRoot":"","sources":["../../src/utilities/extendDrizzleTable.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEpD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAWnC,KAAK,IAAI,GAAG;IACV,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAA;IAChD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,CAAA;IACnD,KAAK,EAAE,KAAK,CAAA;CACb,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,oCAAqC,IAAI,KAAG,IAkC1E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getArrayRelationName.d.ts","sourceRoot":"","sources":["../../src/utilities/getArrayRelationName.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"getArrayRelationName.d.ts","sourceRoot":"","sources":["../../src/utilities/getArrayRelationName.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,eAAO,MAAM,oBAAoB,gCAI9B;IACD,KAAK,EAAE,UAAU,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;CAClB,WAMA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCollectionIdType.d.ts","sourceRoot":"","sources":["../../src/utilities/getCollectionIdType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAUjD,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"getCollectionIdType.d.ts","sourceRoot":"","sources":["../../src/utilities/getCollectionIdType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAUjD,eAAO,MAAM,mBAAmB,6BAG7B;IACD,OAAO,EAAE,cAAc,CAAA;IACvB,UAAU,EAAE,UAAU,CAAA;CACvB,sBAEA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMigrationTemplate.d.ts","sourceRoot":"","sources":["../../src/utilities/getMigrationTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"getMigrationTemplate.d.ts","sourceRoot":"","sources":["../../src/utilities/getMigrationTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,eAAO,MAAM,MAAM,SAAU,MAAM,WAIpB,CAAA;AAEf,eAAO,MAAM,oBAAoB,8CAK9B,qBAAqB,KAAG,MAS1B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNameFromDrizzleTable.d.ts","sourceRoot":"","sources":["../../src/utilities/getNameFromDrizzleTable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAIxC,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"getNameFromDrizzleTable.d.ts","sourceRoot":"","sources":["../../src/utilities/getNameFromDrizzleTable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAIxC,eAAO,MAAM,uBAAuB,UAAW,KAAK,KAAG,MAEtD,CAAA"}
|
|
@@ -2,5 +2,5 @@ import type { DrizzleAdapter, DrizzleTransaction } from '../types.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Returns the correct database instance for reads that are part of a write operation.
|
|
4
4
|
*/
|
|
5
|
-
export declare const getPrimaryDb: (adapter: DrizzleAdapter, db: DrizzleAdapter[
|
|
5
|
+
export declare const getPrimaryDb: (adapter: DrizzleAdapter, db: DrizzleAdapter['drizzle'] | DrizzleTransaction) => import("drizzle-orm/libsql").LibSQLDatabase<Record<string, never>> | import("../types.js").PostgresDB | DrizzleTransaction;
|
|
6
6
|
//# sourceMappingURL=getPrimaryDb.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPrimaryDb.d.ts","sourceRoot":"","sources":["../../src/utilities/getPrimaryDb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErE;;GAEG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"getPrimaryDb.d.ts","sourceRoot":"","sources":["../../src/utilities/getPrimaryDb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErE;;GAEG;AACH,eAAO,MAAM,YAAY,YACd,cAAc,MACnB,cAAc,CAAC,SAAS,CAAC,GAAG,kBAAkB,+HAMnD,CAAA"}
|
|
@@ -9,5 +9,5 @@ import type { DrizzleAdapter } from '../types.js';
|
|
|
9
9
|
* When read replicas are configured and a write happened recently, returns the
|
|
10
10
|
* unwrapped primary to avoid replication-lag stale reads.
|
|
11
11
|
*/
|
|
12
|
-
export declare const getTransaction: <T extends DrizzleAdapter = DrizzleAdapter>(adapter: T, req?: Partial<PayloadRequest>) => Promise<T[
|
|
12
|
+
export declare const getTransaction: <T extends DrizzleAdapter = DrizzleAdapter>(adapter: T, req?: Partial<PayloadRequest>) => Promise<T['drizzle']>;
|
|
13
13
|
//# sourceMappingURL=getTransaction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTransaction.d.ts","sourceRoot":"","sources":["../../src/utilities/getTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAIjD;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,GAAU,CAAC,SAAS,cAAc,GAAG,cAAc,
|
|
1
|
+
{"version":3,"file":"getTransaction.d.ts","sourceRoot":"","sources":["../../src/utilities/getTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAIjD;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,GAAU,CAAC,SAAS,cAAc,GAAG,cAAc,WACnE,CAAC,QACJ,OAAO,CAAC,cAAc,CAAC,KAC5B,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAStB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasLocalesTable.d.ts","sourceRoot":"","sources":["../../src/utilities/hasLocalesTable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAIpC,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"hasLocalesTable.d.ts","sourceRoot":"","sources":["../../src/utilities/hasLocalesTable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAIpC,eAAO,MAAM,eAAe,mCAGzB;IACD,MAAM,EAAE,KAAK,EAAE,CAAA;IACf;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B,KAAG,OAyBH,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isPolymorphicRelationship.d.ts","sourceRoot":"","sources":["../../src/utilities/isPolymorphicRelationship.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,eAAO,MAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"isPolymorphicRelationship.d.ts","sourceRoot":"","sources":["../../src/utilities/isPolymorphicRelationship.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,eAAO,MAAM,yBAAyB,UAC7B,OAAO,KACb,KAAK,IAAI;IACV,UAAU,EAAE,cAAc,CAAA;IAC1B,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CASvB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isUUIDType.d.ts","sourceRoot":"","sources":["../../src/utilities/isUUIDType.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"isUUIDType.d.ts","sourceRoot":"","sources":["../../src/utilities/isUUIDType.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,WAAY,MAAM,KAAG,OAAmD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/utilities/json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAK9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAIjD,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,gBAM/D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,EACpE,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,CAAC,gBAuBT;AAED,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/utilities/json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAK9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAIjD,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,gBAM/D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,EACpE,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,CAAC,gBAuBT;AAED,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,WAC9D,cAAc,SAChB,CAAC,iBAGT,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrationTableExists.d.ts","sourceRoot":"","sources":["../../src/utilities/migrationTableExists.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAExD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7D,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"migrationTableExists.d.ts","sourceRoot":"","sources":["../../src/utilities/migrationTableExists.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAExD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7D,eAAO,MAAM,oBAAoB,YACtB,cAAc,OAClB,cAAc,GAAG,UAAU,KAC/B,OAAO,CAAC,OAAO,CA2BjB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseError.d.ts","sourceRoot":"","sources":["../../src/utilities/parseError.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"parseError.d.ts","sourceRoot":"","sources":["../../src/utilities/parseError.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,UAAU,QAAS,OAAO,OAAO,MAAM,KAAG,MAUtD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pushDevSchema.d.ts","sourceRoot":"","sources":["../../src/utilities/pushDevSchema.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAA;AAUvE;;;;;GAKG;AACH,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"pushDevSchema.d.ts","sourceRoot":"","sources":["../../src/utilities/pushDevSchema.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAA;AAUvE;;;;;GAKG;AACH,eAAO,MAAM,aAAa,YAAmB,cAAc,kBA6F1D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rawConstraint.d.ts","sourceRoot":"","sources":["../../src/utilities/rawConstraint.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,eAA2B,CAAA;AAEtD;;GAEG;AACH,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"rawConstraint.d.ts","sourceRoot":"","sources":["../../src/utilities/rawConstraint.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,eAA2B,CAAA;AAEtD;;GAEG;AACH,eAAO,MAAM,aAAa,UAAW,OAAO;;;CAG1C,CAAA;AAEF,eAAO,MAAM,eAAe,UAAW,OAAO,KAAG,KAAK,IAAI,UAAU,CAAC,OAAO,aAAa,CAExF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitizePathSegment.d.ts","sourceRoot":"","sources":["../../src/utilities/sanitizePathSegment.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"sanitizePathSegment.d.ts","sourceRoot":"","sources":["../../src/utilities/sanitizePathSegment.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,mBAAmB,YAAa,MAAM,KAAG,MAQrD,CAAA"}
|
|
@@ -3,11 +3,7 @@ import type { RawTable } from '../types.js';
|
|
|
3
3
|
type Args = {
|
|
4
4
|
block: Block;
|
|
5
5
|
localized: boolean;
|
|
6
|
-
|
|
7
|
-
* @todo make required in v4.0. Usually you'd wanna pass this in
|
|
8
|
-
*/
|
|
9
|
-
parentIsLocalized?: boolean;
|
|
10
|
-
rootTableName: string;
|
|
6
|
+
parentIsLocalized: boolean;
|
|
11
7
|
table: RawTable;
|
|
12
8
|
tableLocales?: RawTable;
|
|
13
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateExistingBlockIsIdentical.d.ts","sourceRoot":"","sources":["../../src/utilities/validateExistingBlockIsIdentical.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAS,cAAc,EAAE,MAAM,SAAS,CAAA;AAS3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,KAAK,IAAI,GAAG;IACV,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB
|
|
1
|
+
{"version":3,"file":"validateExistingBlockIsIdentical.d.ts","sourceRoot":"","sources":["../../src/utilities/validateExistingBlockIsIdentical.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAS,cAAc,EAAE,MAAM,SAAS,CAAA;AAS3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,KAAK,IAAI,GAAG;IACV,KAAK,EAAE,KAAK,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,KAAK,EAAE,QAAQ,CAAA;IACf,YAAY,CAAC,EAAE,QAAQ,CAAA;CACxB,CAAA;AA+DD;;GAEG;AACH,eAAO,MAAM,gCAAgC,kEAM1C,IAAI,KAAG,OAwBT,CAAA;AAED,eAAO,MAAM,2BAA2B,eAAwC,CAAA;AAChF,eAAO,MAAM,qBAAqB,UAAW,cAAc,SAAS,MAAM,SAEzE,CAAA;AAED,eAAO,MAAM,qBAAqB,UAAW,cAAc,qBAAqB,MAAM,WAMrF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utilities/validateExistingBlockIsIdentical.ts"],"sourcesContent":["import type { Block, Field, FlattenedBlock } from 'payload'\n\nimport {\n fieldAffectsData,\n fieldHasSubFields,\n fieldShouldBeLocalized,\n tabHasName,\n} from 'payload/shared'\n\nimport type { RawTable } from '../types.js'\n\ntype Args = {\n block: Block\n localized: boolean\n
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/validateExistingBlockIsIdentical.ts"],"sourcesContent":["import type { Block, Field, FlattenedBlock } from 'payload'\n\nimport {\n fieldAffectsData,\n fieldHasSubFields,\n fieldShouldBeLocalized,\n tabHasName,\n} from 'payload/shared'\n\nimport type { RawTable } from '../types.js'\n\ntype Args = {\n block: Block\n localized: boolean\n parentIsLocalized: boolean\n table: RawTable\n tableLocales?: RawTable\n}\n\nconst getFlattenedFieldNames = (args: {\n fields: Field[]\n parentIsLocalized: boolean\n prefix?: string\n}): { localized?: boolean; name: string }[] => {\n const { fields, parentIsLocalized, prefix = '' } = args\n return fields.reduce((fieldsToUse, field) => {\n let fieldPrefix = prefix\n\n if (\n ['array', 'blocks', 'relationship', 'upload'].includes(field.type) ||\n ('hasMany' in field && field.hasMany === true)\n ) {\n return fieldsToUse\n }\n\n if (fieldHasSubFields(field)) {\n fieldPrefix = 'name' in field ? `${prefix}${field.name}_` : prefix\n return [\n ...fieldsToUse,\n ...getFlattenedFieldNames({\n fields: field.fields,\n parentIsLocalized: parentIsLocalized || ('localized' in field && field.localized),\n prefix: fieldPrefix,\n }),\n ]\n }\n\n if (field.type === 'tabs') {\n return [\n ...fieldsToUse,\n ...field.tabs.reduce((tabFields, tab) => {\n fieldPrefix = 'name' in tab ? `${prefix}_${tab.name}` : prefix\n return [\n ...tabFields,\n ...(tabHasName(tab)\n ? [{ ...tab, type: 'tab' }]\n : getFlattenedFieldNames({\n fields: tab.fields,\n parentIsLocalized: parentIsLocalized || tab.localized,\n prefix: fieldPrefix,\n })),\n ]\n }, []),\n ]\n }\n\n if (fieldAffectsData(field)) {\n return [\n ...fieldsToUse,\n {\n name: `${fieldPrefix}${field.name}`,\n localized: fieldShouldBeLocalized({ field, parentIsLocalized }),\n },\n ]\n }\n\n return fieldsToUse\n }, [])\n}\n\n/**\n * returns true if all the fields in a block are identical to the existing table\n */\nexport const validateExistingBlockIsIdentical = ({\n block,\n localized,\n parentIsLocalized,\n table,\n tableLocales,\n}: Args): boolean => {\n const fieldNames = getFlattenedFieldNames({\n fields: block.fields,\n parentIsLocalized: parentIsLocalized || localized,\n })\n\n const missingField =\n // ensure every field from the config is in the matching table\n fieldNames.find(({ name, localized }) => {\n const fieldTable = localized && tableLocales ? tableLocales : table\n return Object.keys(fieldTable.columns).indexOf(name) === -1\n }) ||\n // ensure every table column is matched for every field from the config\n Object.keys(table).find((fieldName) => {\n if (!['_locale', '_order', '_parentID', '_path', '_uuid'].includes(fieldName)) {\n return fieldNames.findIndex((field) => field.name) === -1\n }\n })\n\n if (missingField) {\n return false\n }\n\n return Boolean(localized) === Boolean(table.columns._locale)\n}\n\nexport const InternalBlockTableNameIndex = Symbol('InternalBlockTableNameIndex')\nexport const setInternalBlockIndex = (block: FlattenedBlock, index: number) => {\n block[InternalBlockTableNameIndex] = index\n}\n\nexport const resolveBlockTableName = (block: FlattenedBlock, originalTableName: string) => {\n if (!block[InternalBlockTableNameIndex]) {\n return originalTableName\n }\n\n return `${originalTableName}_${block[InternalBlockTableNameIndex]}`\n}\n"],"names":["fieldAffectsData","fieldHasSubFields","fieldShouldBeLocalized","tabHasName","getFlattenedFieldNames","args","fields","parentIsLocalized","prefix","reduce","fieldsToUse","field","fieldPrefix","includes","type","hasMany","name","localized","tabs","tabFields","tab","validateExistingBlockIsIdentical","block","table","tableLocales","fieldNames","missingField","find","fieldTable","Object","keys","columns","indexOf","fieldName","findIndex","Boolean","_locale","InternalBlockTableNameIndex","Symbol","setInternalBlockIndex","index","resolveBlockTableName","originalTableName"],"mappings":"AAEA,SACEA,gBAAgB,EAChBC,iBAAiB,EACjBC,sBAAsB,EACtBC,UAAU,QACL,iBAAgB;AAYvB,MAAMC,yBAAyB,CAACC;IAK9B,MAAM,EAAEC,MAAM,EAAEC,iBAAiB,EAAEC,SAAS,EAAE,EAAE,GAAGH;IACnD,OAAOC,OAAOG,MAAM,CAAC,CAACC,aAAaC;QACjC,IAAIC,cAAcJ;QAElB,IACE;YAAC;YAAS;YAAU;YAAgB;SAAS,CAACK,QAAQ,CAACF,MAAMG,IAAI,KAChE,aAAaH,SAASA,MAAMI,OAAO,KAAK,MACzC;YACA,OAAOL;QACT;QAEA,IAAIT,kBAAkBU,QAAQ;YAC5BC,cAAc,UAAUD,QAAQ,GAAGH,SAASG,MAAMK,IAAI,CAAC,CAAC,CAAC,GAAGR;YAC5D,OAAO;mBACFE;mBACAN,uBAAuB;oBACxBE,QAAQK,MAAML,MAAM;oBACpBC,mBAAmBA,qBAAsB,eAAeI,SAASA,MAAMM,SAAS;oBAChFT,QAAQI;gBACV;aACD;QACH;QAEA,IAAID,MAAMG,IAAI,KAAK,QAAQ;YACzB,OAAO;mBACFJ;mBACAC,MAAMO,IAAI,CAACT,MAAM,CAAC,CAACU,WAAWC;oBAC/BR,cAAc,UAAUQ,MAAM,GAAGZ,OAAO,CAAC,EAAEY,IAAIJ,IAAI,EAAE,GAAGR;oBACxD,OAAO;2BACFW;2BACChB,WAAWiB,OACX;4BAAC;gCAAE,GAAGA,GAAG;gCAAEN,MAAM;4BAAM;yBAAE,GACzBV,uBAAuB;4BACrBE,QAAQc,IAAId,MAAM;4BAClBC,mBAAmBA,qBAAqBa,IAAIH,SAAS;4BACrDT,QAAQI;wBACV;qBACL;gBACH,GAAG,EAAE;aACN;QACH;QAEA,IAAIZ,iBAAiBW,QAAQ;YAC3B,OAAO;mBACFD;gBACH;oBACEM,MAAM,GAAGJ,cAAcD,MAAMK,IAAI,EAAE;oBACnCC,WAAWf,uBAAuB;wBAAES;wBAAOJ;oBAAkB;gBAC/D;aACD;QACH;QAEA,OAAOG;IACT,GAAG,EAAE;AACP;AAEA;;CAEC,GACD,OAAO,MAAMW,mCAAmC,CAAC,EAC/CC,KAAK,EACLL,SAAS,EACTV,iBAAiB,EACjBgB,KAAK,EACLC,YAAY,EACP;IACL,MAAMC,aAAarB,uBAAuB;QACxCE,QAAQgB,MAAMhB,MAAM;QACpBC,mBAAmBA,qBAAqBU;IAC1C;IAEA,MAAMS,eACJ,8DAA8D;IAC9DD,WAAWE,IAAI,CAAC,CAAC,EAAEX,IAAI,EAAEC,SAAS,EAAE;QAClC,MAAMW,aAAaX,aAAaO,eAAeA,eAAeD;QAC9D,OAAOM,OAAOC,IAAI,CAACF,WAAWG,OAAO,EAAEC,OAAO,CAAChB,UAAU,CAAC;IAC5D,MACA,uEAAuE;IACvEa,OAAOC,IAAI,CAACP,OAAOI,IAAI,CAAC,CAACM;QACvB,IAAI,CAAC;YAAC;YAAW;YAAU;YAAa;YAAS;SAAQ,CAACpB,QAAQ,CAACoB,YAAY;YAC7E,OAAOR,WAAWS,SAAS,CAAC,CAACvB,QAAUA,MAAMK,IAAI,MAAM,CAAC;QAC1D;IACF;IAEF,IAAIU,cAAc;QAChB,OAAO;IACT;IAEA,OAAOS,QAAQlB,eAAekB,QAAQZ,MAAMQ,OAAO,CAACK,OAAO;AAC7D,EAAC;AAED,OAAO,MAAMC,8BAA8BC,OAAO,+BAA8B;AAChF,OAAO,MAAMC,wBAAwB,CAACjB,OAAuBkB;IAC3DlB,KAAK,CAACe,4BAA4B,GAAGG;AACvC,EAAC;AAED,OAAO,MAAMC,wBAAwB,CAACnB,OAAuBoB;IAC3D,IAAI,CAACpB,KAAK,CAACe,4BAA4B,EAAE;QACvC,OAAOK;IACT;IAEA,OAAO,GAAGA,kBAAkB,CAAC,EAAEpB,KAAK,CAACe,4BAA4B,EAAE;AACrE,EAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Postgres max identifier length (NAMEDATALEN - 1). */
|
|
2
|
+
export declare const maxIdentifierLength = 63;
|
|
3
|
+
/**
|
|
4
|
+
* Throws if a table or enum identifier exceeds the Postgres 63-char limit.
|
|
5
|
+
*/
|
|
6
|
+
export declare const validateIdentifierLength: (name: string) => string;
|
|
7
|
+
//# sourceMappingURL=validateIdentifierLength.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateIdentifierLength.d.ts","sourceRoot":"","sources":["../../src/utilities/validateIdentifierLength.ts"],"names":[],"mappings":"AAEA,wDAAwD;AACxD,eAAO,MAAM,mBAAmB,KAAK,CAAA;AAErC;;GAEG;AACH,eAAO,MAAM,wBAAwB,SAAU,MAAM,KAAG,MAUvD,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { APIError } from 'payload';
|
|
2
|
+
/** Postgres max identifier length (NAMEDATALEN - 1). */ export const maxIdentifierLength = 63;
|
|
3
|
+
/**
|
|
4
|
+
* Throws if a table or enum identifier exceeds the Postgres 63-char limit.
|
|
5
|
+
*/ export const validateIdentifierLength = (name)=>{
|
|
6
|
+
if (name.length > maxIdentifierLength) {
|
|
7
|
+
throw new APIError(`Exceeded max identifier length for table or enum name of ${maxIdentifierLength} characters. Invalid name: ${name}.
|
|
8
|
+
Tip: You can use the dbName property to reduce the table name length.
|
|
9
|
+
`);
|
|
10
|
+
}
|
|
11
|
+
return name;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=validateIdentifierLength.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/validateIdentifierLength.ts"],"sourcesContent":["import { APIError } from 'payload'\n\n/** Postgres max identifier length (NAMEDATALEN - 1). */\nexport const maxIdentifierLength = 63\n\n/**\n * Throws if a table or enum identifier exceeds the Postgres 63-char limit.\n */\nexport const validateIdentifierLength = (name: string): string => {\n if (name.length > maxIdentifierLength) {\n throw new APIError(\n `Exceeded max identifier length for table or enum name of ${maxIdentifierLength} characters. Invalid name: ${name}.\nTip: You can use the dbName property to reduce the table name length.\n `,\n )\n }\n\n return name\n}\n"],"names":["APIError","maxIdentifierLength","validateIdentifierLength","name","length"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,UAAS;AAElC,sDAAsD,GACtD,OAAO,MAAMC,sBAAsB,GAAE;AAErC;;CAEC,GACD,OAAO,MAAMC,2BAA2B,CAACC;IACvC,IAAIA,KAAKC,MAAM,GAAGH,qBAAqB;QACrC,MAAM,IAAID,SACR,CAAC,yDAAyD,EAAEC,oBAAoB,2BAA2B,EAAEE,KAAK;;MAElH,CAAC;IAEL;IAEA,OAAOA;AACT,EAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { maxIdentifierLength, validateIdentifierLength } from './validateIdentifierLength.js';
|
|
3
|
+
describe('validateIdentifierLength', ()=>{
|
|
4
|
+
it('should return the name unchanged when at or under the 63-char limit', ()=>{
|
|
5
|
+
const name = 'a'.repeat(maxIdentifierLength);
|
|
6
|
+
expect(validateIdentifierLength(name)).toBe(name);
|
|
7
|
+
});
|
|
8
|
+
it('should throw when the name exceeds the 63-char limit', ()=>{
|
|
9
|
+
const name = 'a'.repeat(maxIdentifierLength + 1);
|
|
10
|
+
expect(()=>validateIdentifierLength(name)).toThrow('Exceeded max identifier length');
|
|
11
|
+
});
|
|
12
|
+
it('should include the invalid name and the dbName tip in the error', ()=>{
|
|
13
|
+
const name = `some_long_table_name${'x'.repeat(maxIdentifierLength)}_locales`;
|
|
14
|
+
expect(()=>validateIdentifierLength(name)).toThrow(name);
|
|
15
|
+
expect(()=>validateIdentifierLength(name)).toThrow('You can use the dbName property to reduce the table name length');
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=validateIdentifierLength.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/validateIdentifierLength.spec.ts"],"sourcesContent":["import { describe, expect, it } from 'vitest'\n\nimport { maxIdentifierLength, validateIdentifierLength } from './validateIdentifierLength.js'\n\ndescribe('validateIdentifierLength', () => {\n it('should return the name unchanged when at or under the 63-char limit', () => {\n const name = 'a'.repeat(maxIdentifierLength)\n\n expect(validateIdentifierLength(name)).toBe(name)\n })\n\n it('should throw when the name exceeds the 63-char limit', () => {\n const name = 'a'.repeat(maxIdentifierLength + 1)\n\n expect(() => validateIdentifierLength(name)).toThrow('Exceeded max identifier length')\n })\n\n it('should include the invalid name and the dbName tip in the error', () => {\n const name = `some_long_table_name${'x'.repeat(maxIdentifierLength)}_locales`\n\n expect(() => validateIdentifierLength(name)).toThrow(name)\n expect(() => validateIdentifierLength(name)).toThrow(\n 'You can use the dbName property to reduce the table name length',\n )\n })\n})\n"],"names":["describe","expect","it","maxIdentifierLength","validateIdentifierLength","name","repeat","toBe","toThrow"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,SAAQ;AAE7C,SAASC,mBAAmB,EAAEC,wBAAwB,QAAQ,gCAA+B;AAE7FJ,SAAS,4BAA4B;IACnCE,GAAG,uEAAuE;QACxE,MAAMG,OAAO,IAAIC,MAAM,CAACH;QAExBF,OAAOG,yBAAyBC,OAAOE,IAAI,CAACF;IAC9C;IAEAH,GAAG,wDAAwD;QACzD,MAAMG,OAAO,IAAIC,MAAM,CAACH,sBAAsB;QAE9CF,OAAO,IAAMG,yBAAyBC,OAAOG,OAAO,CAAC;IACvD;IAEAN,GAAG,mEAAmE;QACpE,MAAMG,OAAO,CAAC,oBAAoB,EAAE,IAAIC,MAAM,CAACH,qBAAqB,QAAQ,CAAC;QAE7EF,OAAO,IAAMG,yBAAyBC,OAAOG,OAAO,CAACH;QACrDJ,OAAO,IAAMG,yBAAyBC,OAAOG,OAAO,CAClD;IAEJ;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/drizzle",
|
|
3
|
-
"version": "4.0.0-internal.
|
|
3
|
+
"version": "4.0.0-internal.567a487",
|
|
4
4
|
"description": "A library of shared functions used by different payload database adapters",
|
|
5
5
|
"homepage": "https://payloadcms.com",
|
|
6
6
|
"repository": {
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"@types/pg": "8.20.0",
|
|
56
56
|
"@types/to-snake-case": "1.0.0",
|
|
57
57
|
"@payloadcms/eslint-config": "3.28.0",
|
|
58
|
-
"payload": "4.0.0-internal.
|
|
58
|
+
"payload": "4.0.0-internal.567a487"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"payload": "4.0.0-internal.
|
|
61
|
+
"payload": "4.0.0-internal.567a487"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"build": "pnpm build:swc && pnpm build:types",
|