@payloadcms/drizzle 4.0.0-internal.e16cf59 → 4.0.0-internal.fa345ef
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/LICENSE.md +1 -1
- package/dist/createTableName.d.ts.map +1 -1
- package/dist/exports/postgres.d.ts +1 -0
- package/dist/exports/postgres.d.ts.map +1 -1
- package/dist/exports/postgres.js +1 -0
- package/dist/exports/postgres.js.map +1 -1
- package/dist/exports/sqlite.d.ts +1 -0
- package/dist/exports/sqlite.d.ts.map +1 -1
- package/dist/exports/sqlite.js +1 -0
- package/dist/exports/sqlite.js.map +1 -1
- package/dist/find/buildFindManyArgs.d.ts.map +1 -1
- package/dist/find/findMany.d.ts.map +1 -1
- package/dist/find/traverseFields.d.ts.map +1 -1
- package/dist/find/traverseFields.js +1 -2
- package/dist/find/traverseFields.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- 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/localize-status/index.d.ts +11 -0
- package/dist/postgres/predefinedMigrations/localize-status/index.d.ts.map +1 -0
- package/dist/postgres/predefinedMigrations/localize-status/index.js +296 -0
- package/dist/postgres/predefinedMigrations/localize-status/index.js.map +1 -0
- package/dist/postgres/predefinedMigrations/localize-status/migrateMainCollection.d.ts +13 -0
- package/dist/postgres/predefinedMigrations/localize-status/migrateMainCollection.d.ts.map +1 -0
- package/dist/postgres/predefinedMigrations/localize-status/migrateMainCollection.js +51 -0
- package/dist/postgres/predefinedMigrations/localize-status/migrateMainCollection.js.map +1 -0
- package/dist/postgres/predefinedMigrations/localize-status/migrateMainGlobal.d.ts +13 -0
- package/dist/postgres/predefinedMigrations/localize-status/migrateMainGlobal.d.ts.map +1 -0
- package/dist/postgres/predefinedMigrations/localize-status/migrateMainGlobal.js +54 -0
- package/dist/postgres/predefinedMigrations/localize-status/migrateMainGlobal.js.map +1 -0
- 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/fetchAndResave/traverseFields.js.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.map +1 -1
- package/dist/queries/addJoinTable.d.ts.map +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/getTableColumnFromPath.js +2 -2
- package/dist/queries/getTableColumnFromPath.js.map +1 -1
- package/dist/queries/sanitizeQueryValue.d.ts.map +1 -1
- package/dist/queries/selectDistinct.d.ts.map +1 -1
- package/dist/schema/build.d.ts.map +1 -1
- package/dist/schema/buildDrizzleRelations.d.ts.map +1 -1
- package/dist/schema/buildRawSchema.d.ts.map +1 -1
- package/dist/schema/idToUUID.d.ts.map +1 -1
- package/dist/schema/traverseFields.d.ts.map +1 -1
- package/dist/schema/traverseFields.js +1 -1
- 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/sqlite/predefinedMigrations/localize-status/index.d.ts +28 -0
- package/dist/sqlite/predefinedMigrations/localize-status/index.d.ts.map +1 -0
- package/dist/sqlite/predefinedMigrations/localize-status/index.js +198 -0
- package/dist/sqlite/predefinedMigrations/localize-status/index.js.map +1 -0
- package/dist/sqlite/predefinedMigrations/localize-status/migrateMainCollection.d.ts +12 -0
- package/dist/sqlite/predefinedMigrations/localize-status/migrateMainCollection.d.ts.map +1 -0
- package/dist/sqlite/predefinedMigrations/localize-status/migrateMainCollection.js +24 -0
- package/dist/sqlite/predefinedMigrations/localize-status/migrateMainCollection.js.map +1 -0
- package/dist/sqlite/predefinedMigrations/localize-status/migrateMainGlobal.d.ts +12 -0
- package/dist/sqlite/predefinedMigrations/localize-status/migrateMainGlobal.d.ts.map +1 -0
- package/dist/sqlite/predefinedMigrations/localize-status/migrateMainGlobal.js +28 -0
- package/dist/sqlite/predefinedMigrations/localize-status/migrateMainGlobal.js.map +1 -0
- 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/read/traverseFields.js +2 -2
- package/dist/transform/read/traverseFields.js.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/blocks.js +1 -1
- package/dist/transform/write/blocks.js.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/transform/write/traverseFields.js +1 -2
- package/dist/transform/write/traverseFields.js.map +1 -1
- package/dist/types.d.ts +0 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -3
- package/dist/types.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/handleUpsertError.js +2 -1
- package/dist/upsertRow/handleUpsertError.js.map +1 -1
- package/dist/upsertRow/handleUpsertError.spec.js +42 -0
- package/dist/upsertRow/handleUpsertError.spec.js.map +1 -0
- package/dist/upsertRow/index.d.ts.map +1 -1
- package/dist/upsertRow/index.js +5 -2
- package/dist/upsertRow/index.js.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.map +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.map +1 -1
- package/package.json +4 -9
- package/dist/exports/types-deprecated.d.ts +0 -150
- package/dist/exports/types-deprecated.d.ts.map +0 -1
- package/dist/exports/types-deprecated.js +0 -5
- package/dist/exports/types-deprecated.js.map +0 -1
- package/dist/find/chainMethods.d.ts +0 -20
- package/dist/find/chainMethods.d.ts.map +0 -1
- package/dist/find/chainMethods.js +0 -16
- package/dist/find/chainMethods.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/upsertRow/index.ts"],"sourcesContent":["import type { LibSQLDatabase } from 'drizzle-orm/libsql'\nimport type { SelectedFields } from 'drizzle-orm/sqlite-core'\nimport type { TypeWithID } from 'payload'\n\nimport { and, desc, eq, isNull, or } from 'drizzle-orm'\n\nimport type { BlockRowToInsert } from '../transform/write/types.js'\nimport type { Args } from './types.js'\n\ntype RelationshipRow = {\n [key: string]: number | string | undefined // For relationship ID columns like categoriesID, moviesID, etc.\n id?: number | string\n locale?: string\n order: number\n parent: number | string // Drizzle table uses 'parent' key\n path: string\n}\n\nimport { buildFindManyArgs } from '../find/buildFindManyArgs.js'\nimport { transform } from '../transform/read/index.js'\nimport { transformForWrite } from '../transform/write/index.js'\nimport { markWrite } from '../utilities/readAfterWrite.js'\nimport { deleteExistingArrayRows } from './deleteExistingArrayRows.js'\nimport { deleteExistingRowsByPath } from './deleteExistingRowsByPath.js'\nimport { handleUpsertError } from './handleUpsertError.js'\nimport { insertArrays } from './insertArrays.js'\nimport { shouldUseOptimizedUpsertRow } from './shouldUseOptimizedUpsertRow.js'\n\n/**\n * If `id` is provided, it will update the row with that ID.\n * If `where` is provided, it will update the row that matches the `where`\n * If neither `id` nor `where` is provided, it will create a new row.\n *\n * adapter function replaces the entire row and does not support partial updates.\n */\nexport const upsertRow = async <T extends Record<string, unknown> | TypeWithID>({\n id,\n adapter,\n collectionSlug,\n data,\n db,\n fields,\n globalSlug,\n ignoreResult,\n // TODO:\n // When we support joins for write operations (create/update) - pass collectionSlug to the buildFindManyArgs\n // Make a new argument in upsertRow.ts and pass the slug from every operation.\n customID,\n joinQuery: _joinQuery,\n operation,\n path = '',\n req,\n select,\n tableName,\n upsertTarget,\n where,\n}: Args): Promise<T> => {\n if (operation === 'create' && !data.createdAt) {\n data.createdAt = new Date().toISOString()\n }\n\n markWrite(adapter)\n\n let insertedRow: Record<string, unknown> = { id }\n if (id && shouldUseOptimizedUpsertRow({ data, fields })) {\n try {\n const transformedForWrite = transformForWrite({\n adapter,\n data,\n enableAtomicWrites: true,\n fields,\n tableName,\n })\n const { row } = transformedForWrite\n const { arraysToPush } = transformedForWrite\n\n const drizzle = db as LibSQLDatabase\n\n // First, handle $push arrays\n\n if (arraysToPush && Object.keys(arraysToPush)?.length) {\n await insertArrays({\n adapter,\n arrays: [arraysToPush],\n db,\n parentRows: [insertedRow],\n uuidMap: {},\n })\n }\n\n // If row.updatedAt is not set, delete it to avoid triggering hasDataToUpdate. `updatedAt` may be explicitly set to null to\n // disable triggering hasDataToUpdate.\n if (typeof row.updatedAt === 'undefined' || row.updatedAt === null) {\n delete row.updatedAt\n }\n\n const hasDataToUpdate = row && Object.keys(row)?.length\n\n // Then, handle regular row update\n if (ignoreResult) {\n if (hasDataToUpdate) {\n // Only update row if there is something to update.\n // Example: if the data only consists of a single $push, calling insertArrays is enough - we don't need to update the row.\n await drizzle\n .update(adapter.tables[tableName])\n .set(row)\n .where(eq(adapter.tables[tableName].id, id))\n }\n return ignoreResult === 'idOnly' ? ({ id } as T) : null\n }\n\n const findManyArgs = buildFindManyArgs({\n adapter,\n depth: 0,\n fields,\n joinQuery: false,\n select,\n tableName,\n })\n\n const findManyKeysLength = Object.keys(findManyArgs).length\n const hasOnlyColumns = Object.keys(findManyArgs.columns || {}).length > 0\n\n if (!hasDataToUpdate) {\n // Nothing to update => just fetch current row and return\n findManyArgs.where = eq(adapter.tables[tableName].id, insertedRow.id)\n\n const doc = await db.query[tableName].findFirst(findManyArgs)\n\n return transform<T>({\n adapter,\n config: adapter.payload.config,\n data: doc,\n fields,\n joinQuery: false,\n tableName,\n })\n }\n\n if (findManyKeysLength === 0 || hasOnlyColumns) {\n // Optimization - No need for joins => can simply use returning(). This is optimal for very simple collections\n // without complex fields that live in separate tables like blocks, arrays, relationships, etc.\n\n const selectedFields: SelectedFields = {}\n if (hasOnlyColumns) {\n for (const [column, enabled] of Object.entries(findManyArgs.columns)) {\n if (enabled) {\n selectedFields[column] = adapter.tables[tableName][column]\n }\n }\n }\n\n const docs = await drizzle\n .update(adapter.tables[tableName])\n .set(row)\n .where(eq(adapter.tables[tableName].id, id))\n .returning(Object.keys(selectedFields).length ? selectedFields : undefined)\n\n return transform<T>({\n adapter,\n config: adapter.payload.config,\n data: docs[0],\n fields,\n joinQuery: false,\n tableName,\n })\n }\n\n // DB Update that needs the result, potentially with joins => need to update first, then find. returning() does not work with joins.\n\n await drizzle\n .update(adapter.tables[tableName])\n .set(row)\n .where(eq(adapter.tables[tableName].id, id))\n\n findManyArgs.where = eq(adapter.tables[tableName].id, insertedRow.id)\n\n const doc = await db.query[tableName].findFirst(findManyArgs)\n\n return transform<T>({\n adapter,\n config: adapter.payload.config,\n data: doc,\n fields,\n joinQuery: false,\n tableName,\n })\n } catch (error) {\n handleUpsertError({ id, adapter, collectionSlug, error, globalSlug, req, tableName })\n }\n }\n // Split out the incoming data into the corresponding:\n // base row, locales, relationships, blocks, and arrays\n const rowToInsert = transformForWrite({\n adapter,\n data,\n enableAtomicWrites: false,\n fields,\n path,\n tableName,\n })\n\n if (customID) {\n rowToInsert.row.id = customID\n }\n\n // First, we insert the main row\n try {\n if (operation === 'update') {\n const target = upsertTarget || adapter.tables[tableName].id\n\n // Check if we only have relationship operations and no main row data to update\n // Exclude timestamp-only updates when we only have relationship operations\n const rowKeys = Object.keys(rowToInsert.row)\n const hasMainRowData =\n rowKeys.length > 0 && !rowKeys.every((key) => key === 'updatedAt' || key === 'createdAt')\n\n if (hasMainRowData) {\n if (id) {\n rowToInsert.row.id = id\n ;[insertedRow] = await adapter.insert({\n db,\n onConflictDoUpdate: { set: rowToInsert.row, target },\n tableName,\n values: rowToInsert.row,\n })\n } else {\n ;[insertedRow] = await adapter.insert({\n db,\n onConflictDoUpdate: { set: rowToInsert.row, target, where },\n tableName,\n values: rowToInsert.row,\n })\n }\n } else {\n // No main row data to update, just use the existing ID\n insertedRow = { id }\n }\n } else {\n if (adapter.allowIDOnCreate && data.id) {\n rowToInsert.row.id = data.id\n }\n ;[insertedRow] = await adapter.insert({\n db,\n tableName,\n values: rowToInsert.row,\n })\n }\n\n const localesToInsert: Record<string, unknown>[] = []\n const relationsToInsert: Record<string, unknown>[] = []\n const textsToInsert: Record<string, unknown>[] = []\n const numbersToInsert: Record<string, unknown>[] = []\n const blocksToInsert: { [blockType: string]: BlockRowToInsert[] } = {}\n const selectsToInsert: { [selectTableName: string]: Record<string, unknown>[] } = {}\n\n // If there are locale rows with data, add the parent and locale to each\n if (Object.keys(rowToInsert.locales).length > 0) {\n Object.entries(rowToInsert.locales).forEach(([locale, localeRow]) => {\n localeRow._parentID = insertedRow.id\n localeRow._locale = locale\n localesToInsert.push(localeRow)\n })\n }\n\n // If there are relationships, add parent to each\n if (rowToInsert.relationships.length > 0) {\n rowToInsert.relationships.forEach((relation) => {\n relation.parent = insertedRow.id\n relationsToInsert.push(relation)\n })\n }\n\n // If there are texts, add parent to each\n if (rowToInsert.texts.length > 0) {\n rowToInsert.texts.forEach((textRow) => {\n textRow.parent = insertedRow.id\n textsToInsert.push(textRow)\n })\n }\n\n // If there are numbers, add parent to each\n if (rowToInsert.numbers.length > 0) {\n rowToInsert.numbers.forEach((numberRow) => {\n numberRow.parent = insertedRow.id\n numbersToInsert.push(numberRow)\n })\n }\n\n // If there are selects, add parent to each, and then\n // store by table name and rows\n if (Object.keys(rowToInsert.selects).length > 0) {\n Object.entries(rowToInsert.selects).forEach(([selectTableName, selectRows]) => {\n selectsToInsert[selectTableName] = []\n\n selectRows.forEach((row) => {\n if (typeof row.parent === 'undefined') {\n row.parent = insertedRow.id\n }\n\n selectsToInsert[selectTableName].push(row)\n })\n })\n }\n\n // If there are blocks, add parent to each, and then\n // store by table name and rows\n Object.keys(rowToInsert.blocks).forEach((tableName) => {\n rowToInsert.blocks[tableName].forEach((blockRow) => {\n blockRow.row._parentID = insertedRow.id\n if (!blocksToInsert[tableName]) {\n blocksToInsert[tableName] = []\n }\n if (blockRow.row.uuid) {\n delete blockRow.row.uuid\n }\n blocksToInsert[tableName].push(blockRow)\n })\n })\n\n // //////////////////////////////////\n // INSERT LOCALES\n // //////////////////////////////////\n\n if (localesToInsert.length > 0) {\n const localeTableName = `${tableName}${adapter.localesSuffix}`\n const localeTable = adapter.tables[`${tableName}${adapter.localesSuffix}`]\n\n if (operation === 'update') {\n await adapter.deleteWhere({\n db,\n tableName: localeTableName,\n where: eq(localeTable._parentID, insertedRow.id),\n })\n }\n\n await adapter.insert({\n db,\n tableName: localeTableName,\n values: localesToInsert,\n })\n }\n\n // //////////////////////////////////\n // INSERT RELATIONSHIPS\n // //////////////////////////////////\n\n const relationshipsTableName = `${tableName}${adapter.relationshipsSuffix}`\n\n if (operation === 'update') {\n // Filter out specific item deletions (those with itemToRemove) from general path deletions\n const generalRelationshipDeletes = rowToInsert.relationshipsToDelete.filter(\n (rel) => !('itemToRemove' in rel),\n )\n\n await deleteExistingRowsByPath({\n adapter,\n db,\n localeColumnName: 'locale',\n parentColumnName: 'parent',\n parentID: insertedRow.id,\n pathColumnName: 'path',\n rows: [...relationsToInsert, ...generalRelationshipDeletes],\n tableName: relationshipsTableName,\n })\n }\n\n if (relationsToInsert.length > 0) {\n await adapter.insert({\n db,\n tableName: relationshipsTableName,\n values: relationsToInsert,\n })\n }\n\n // //////////////////////////////////\n // HANDLE RELATIONSHIP $push OPERATIONS\n // //////////////////////////////////\n\n if (rowToInsert.relationshipsToAppend.length > 0) {\n // Prepare all relationships for batch insert (order will be set after max query)\n const relationshipsToInsert = rowToInsert.relationshipsToAppend.map((rel) => {\n const parentId = id || insertedRow.id\n const row: Record<string, unknown> = {\n parent: parentId as number | string, // Use 'parent' key for Drizzle table\n path: rel.path,\n }\n\n // Only add locale if this relationship table has a locale column\n const relationshipTable = adapter.rawTables[relationshipsTableName]\n if (rel.locale && relationshipTable && relationshipTable.columns.locale) {\n row.locale = rel.locale\n }\n\n if (rel.relationTo) {\n // Use camelCase key for Drizzle table (e.g., categoriesID not categories_id)\n row[`${rel.relationTo}ID`] = rel.value\n }\n\n return row\n })\n\n if (relationshipsToInsert.length > 0) {\n // Check for potential duplicates\n const relationshipTable = adapter.tables[relationshipsTableName]\n\n if (relationshipTable) {\n // Build conditions only if we have relationships to check\n if (relationshipsToInsert.length === 0) {\n return // No relationships to insert\n }\n\n const conditions = relationshipsToInsert.map((row: RelationshipRow) => {\n const parts = [\n eq(relationshipTable.parent, row.parent),\n eq(relationshipTable.path, row.path),\n ]\n\n // Add locale condition\n if (row.locale !== undefined && relationshipTable.locale) {\n parts.push(eq(relationshipTable.locale, row.locale))\n } else if (relationshipTable.locale) {\n parts.push(isNull(relationshipTable.locale))\n }\n\n // Add all relationship ID matches using schema fields\n for (const [key, value] of Object.entries(row)) {\n if (key.endsWith('ID') && value != null) {\n const column = relationshipTable[key]\n if (column && typeof column === 'object') {\n parts.push(eq(column, value))\n }\n }\n }\n\n return and(...parts)\n })\n\n // Get both existing relationships AND max order in a single query\n let existingRels: Record<string, unknown>[] = []\n let maxOrder = 0\n\n if (conditions.length > 0) {\n // Query for existing relationships\n existingRels = await (db as any)\n .select()\n .from(relationshipTable)\n .where(or(...conditions))\n }\n\n // Get max order for this parent across all paths in a single query\n const parentId = id || insertedRow.id\n const maxOrderResult = await (db as any)\n .select({ maxOrder: relationshipTable.order })\n .from(relationshipTable)\n .where(eq(relationshipTable.parent, parentId))\n .orderBy(desc(relationshipTable.order))\n .limit(1)\n\n if (maxOrderResult.length > 0 && maxOrderResult[0].maxOrder) {\n maxOrder = maxOrderResult[0].maxOrder\n }\n\n // Set order values for all relationships based on max order\n relationshipsToInsert.forEach((row, index) => {\n row.order = maxOrder + index + 1\n })\n\n // Filter out relationships that already exist\n const relationshipsToActuallyInsert = relationshipsToInsert.filter((newRow) => {\n return !existingRels.some((existingRow: Record<string, unknown>) => {\n // Check if this relationship already exists\n let matches = existingRow.parent === newRow.parent && existingRow.path === newRow.path\n\n if (newRow.locale !== undefined) {\n matches = matches && existingRow.locale === newRow.locale\n }\n\n // Check relationship value matches - convert to camelCase for comparison\n for (const key of Object.keys(newRow)) {\n if (key.endsWith('ID')) {\n // Now using camelCase keys\n matches = matches && existingRow[key] === newRow[key]\n }\n }\n\n return matches\n })\n })\n\n // Insert only non-duplicate relationships\n if (relationshipsToActuallyInsert.length > 0) {\n await adapter.insert({\n db,\n tableName: relationshipsTableName,\n values: relationshipsToActuallyInsert,\n })\n }\n }\n }\n }\n\n // //////////////////////////////////\n // HANDLE RELATIONSHIP $remove OPERATIONS\n // //////////////////////////////////\n\n if (rowToInsert.relationshipsToDelete.some((rel) => 'itemToRemove' in rel)) {\n const relationshipTable = adapter.tables[relationshipsTableName]\n\n if (relationshipTable) {\n for (const relToDelete of rowToInsert.relationshipsToDelete) {\n if ('itemToRemove' in relToDelete && relToDelete.itemToRemove) {\n const item = relToDelete.itemToRemove\n const parentId = (id || insertedRow.id) as number | string\n\n const conditions = [\n eq(relationshipTable.parent, parentId),\n eq(relationshipTable.path, relToDelete.path),\n ]\n\n // Add locale condition if this relationship table has a locale column\n if (adapter.rawTables[relationshipsTableName]?.columns.locale) {\n if (relToDelete.locale) {\n conditions.push(eq(relationshipTable.locale, relToDelete.locale))\n } else {\n conditions.push(isNull(relationshipTable.locale))\n }\n }\n\n // Handle polymorphic vs simple relationships\n if (typeof item === 'object' && 'relationTo' in item) {\n // Polymorphic relationship - convert to camelCase key\n const camelKey = `${item.relationTo}ID`\n if (relationshipTable[camelKey]) {\n conditions.push(eq(relationshipTable[camelKey], item.value))\n }\n } else if (relToDelete.relationTo) {\n // Simple relationship - convert to camelCase key\n const camelKey = `${relToDelete.relationTo}ID`\n if (relationshipTable[camelKey]) {\n conditions.push(eq(relationshipTable[camelKey], item))\n }\n }\n\n // Execute DELETE using Drizzle query builder\n await adapter.deleteWhere({\n db,\n tableName: relationshipsTableName,\n where: and(...conditions),\n })\n }\n }\n }\n }\n\n // //////////////////////////////////\n // INSERT hasMany TEXTS\n // //////////////////////////////////\n\n const textsTableName = `${tableName}_texts`\n\n if (operation === 'update') {\n await deleteExistingRowsByPath({\n adapter,\n db,\n localeColumnName: 'locale',\n parentColumnName: 'parent',\n parentID: insertedRow.id,\n pathColumnName: 'path',\n rows: [...textsToInsert, ...rowToInsert.textsToDelete],\n tableName: textsTableName,\n })\n }\n\n if (textsToInsert.length > 0) {\n await adapter.insert({\n db,\n tableName: textsTableName,\n values: textsToInsert,\n })\n }\n\n // //////////////////////////////////\n // INSERT hasMany NUMBERS\n // //////////////////////////////////\n\n const numbersTableName = `${tableName}_numbers`\n\n if (operation === 'update') {\n await deleteExistingRowsByPath({\n adapter,\n db,\n localeColumnName: 'locale',\n parentColumnName: 'parent',\n parentID: insertedRow.id,\n pathColumnName: 'path',\n rows: [...numbersToInsert, ...rowToInsert.numbersToDelete],\n tableName: numbersTableName,\n })\n }\n\n if (numbersToInsert.length > 0) {\n await adapter.insert({\n db,\n tableName: numbersTableName,\n values: numbersToInsert,\n })\n }\n\n // //////////////////////////////////\n // INSERT BLOCKS\n // //////////////////////////////////\n\n const insertedBlockRows: Record<string, Record<string, unknown>[]> = {}\n\n if (operation === 'update') {\n for (const tableName of rowToInsert.blocksToDelete) {\n const blockTable = adapter.tables[tableName]\n await adapter.deleteWhere({\n db,\n tableName,\n where: eq(blockTable._parentID, insertedRow.id),\n })\n }\n }\n\n // When versions are enabled, adapter is used to track mapping between blocks/arrays ObjectID to their numeric generated representation, then we use it for nested to arrays/blocks select hasMany in versions.\n const arraysBlocksUUIDMap: Record<string, number | string> = {}\n\n for (const [tableName, blockRows] of Object.entries(blocksToInsert)) {\n insertedBlockRows[tableName] = await adapter.insert({\n db,\n tableName,\n values: blockRows.map(({ row }) => row),\n })\n\n insertedBlockRows[tableName].forEach((row, i) => {\n blockRows[i].row = row\n if (\n typeof row._uuid === 'string' &&\n (typeof row.id === 'string' || typeof row.id === 'number')\n ) {\n arraysBlocksUUIDMap[row._uuid] = row.id\n }\n })\n\n const blockLocaleIndexMap: number[] = []\n\n const blockLocaleRowsToInsert = blockRows.reduce((acc, blockRow, i) => {\n if (Object.entries(blockRow.locales).length > 0) {\n Object.entries(blockRow.locales).forEach(([blockLocale, blockLocaleData]) => {\n if (Object.keys(blockLocaleData).length > 0) {\n blockLocaleData._parentID = blockRow.row.id\n blockLocaleData._locale = blockLocale\n acc.push(blockLocaleData)\n blockLocaleIndexMap.push(i)\n }\n })\n }\n\n return acc\n }, [])\n\n if (blockLocaleRowsToInsert.length > 0) {\n await adapter.insert({\n db,\n tableName: `${tableName}${adapter.localesSuffix}`,\n values: blockLocaleRowsToInsert,\n })\n }\n\n await insertArrays({\n adapter,\n arrays: blockRows.map(({ arrays }) => arrays),\n db,\n parentRows: insertedBlockRows[tableName],\n uuidMap: arraysBlocksUUIDMap,\n })\n }\n\n // //////////////////////////////////\n // INSERT ARRAYS RECURSIVELY\n // //////////////////////////////////\n\n if (operation === 'update') {\n for (const arrayTableName of Object.keys(rowToInsert.arrays)) {\n await deleteExistingArrayRows({\n adapter,\n db,\n parentID: insertedRow.id,\n tableName: arrayTableName,\n })\n }\n }\n\n await insertArrays({\n adapter,\n arrays: [rowToInsert.arrays, rowToInsert.arraysToPush],\n db,\n parentRows: [insertedRow, insertedRow],\n uuidMap: arraysBlocksUUIDMap,\n })\n\n // //////////////////////////////////\n // INSERT hasMany SELECTS\n // //////////////////////////////////\n\n for (const [selectTableName, tableRows] of Object.entries(selectsToInsert)) {\n const selectTable = adapter.tables[selectTableName]\n if (operation === 'update') {\n await adapter.deleteWhere({\n db,\n tableName: selectTableName,\n where: eq(selectTable.parent, insertedRow.id),\n })\n }\n\n if (Object.keys(arraysBlocksUUIDMap).length > 0) {\n tableRows.forEach((row: RelationshipRow) => {\n if (row.parent in arraysBlocksUUIDMap) {\n row.parent = arraysBlocksUUIDMap[row.parent]\n }\n })\n }\n\n if (tableRows.length) {\n await adapter.insert({\n db,\n tableName: selectTableName,\n values: tableRows,\n })\n }\n }\n } catch (error) {\n handleUpsertError({ id, adapter, collectionSlug, error, globalSlug, req, tableName })\n }\n\n if (ignoreResult === 'idOnly') {\n return { id: insertedRow.id } as T\n }\n\n if (ignoreResult) {\n return data as T\n }\n\n // //////////////////////////////////\n // RETRIEVE NEWLY UPDATED ROW\n // //////////////////////////////////\n\n const findManyArgs = buildFindManyArgs({\n adapter,\n depth: 0,\n fields,\n joinQuery: false,\n select,\n tableName,\n })\n\n findManyArgs.where = eq(adapter.tables[tableName].id, insertedRow.id)\n\n const doc = await db.query[tableName].findFirst(findManyArgs)\n\n // //////////////////////////////////\n // TRANSFORM DATA\n // //////////////////////////////////\n\n const result = transform<T>({\n adapter,\n config: adapter.payload.config,\n data: doc,\n fields,\n joinQuery: false,\n tableName,\n })\n\n return result\n}\n"],"names":["and","desc","eq","isNull","or","buildFindManyArgs","transform","transformForWrite","markWrite","deleteExistingArrayRows","deleteExistingRowsByPath","handleUpsertError","insertArrays","shouldUseOptimizedUpsertRow","upsertRow","id","adapter","collectionSlug","data","db","fields","globalSlug","ignoreResult","customID","joinQuery","_joinQuery","operation","path","req","select","tableName","upsertTarget","where","createdAt","Date","toISOString","insertedRow","transformedForWrite","enableAtomicWrites","row","arraysToPush","drizzle","Object","keys","length","arrays","parentRows","uuidMap","updatedAt","hasDataToUpdate","update","tables","set","findManyArgs","depth","findManyKeysLength","hasOnlyColumns","columns","doc","query","findFirst","config","payload","selectedFields","column","enabled","entries","docs","returning","undefined","error","rowToInsert","target","rowKeys","hasMainRowData","every","key","insert","onConflictDoUpdate","values","allowIDOnCreate","localesToInsert","relationsToInsert","textsToInsert","numbersToInsert","blocksToInsert","selectsToInsert","locales","forEach","locale","localeRow","_parentID","_locale","push","relationships","relation","parent","texts","textRow","numbers","numberRow","selects","selectTableName","selectRows","blocks","blockRow","uuid","localeTableName","localesSuffix","localeTable","deleteWhere","relationshipsTableName","relationshipsSuffix","generalRelationshipDeletes","relationshipsToDelete","filter","rel","localeColumnName","parentColumnName","parentID","pathColumnName","rows","relationshipsToAppend","relationshipsToInsert","map","parentId","relationshipTable","rawTables","relationTo","value","conditions","parts","endsWith","existingRels","maxOrder","from","maxOrderResult","order","orderBy","limit","index","relationshipsToActuallyInsert","newRow","some","existingRow","matches","relToDelete","itemToRemove","item","camelKey","textsTableName","textsToDelete","numbersTableName","numbersToDelete","insertedBlockRows","blocksToDelete","blockTable","arraysBlocksUUIDMap","blockRows","i","_uuid","blockLocaleIndexMap","blockLocaleRowsToInsert","reduce","acc","blockLocale","blockLocaleData","arrayTableName","tableRows","selectTable","result"],"mappings":"AAIA,SAASA,GAAG,EAAEC,IAAI,EAAEC,EAAE,EAAEC,MAAM,EAAEC,EAAE,QAAQ,cAAa;AAcvD,SAASC,iBAAiB,QAAQ,+BAA8B;AAChE,SAASC,SAAS,QAAQ,6BAA4B;AACtD,SAASC,iBAAiB,QAAQ,8BAA6B;AAC/D,SAASC,SAAS,QAAQ,iCAAgC;AAC1D,SAASC,uBAAuB,QAAQ,+BAA8B;AACtE,SAASC,wBAAwB,QAAQ,gCAA+B;AACxE,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,YAAY,QAAQ,oBAAmB;AAChD,SAASC,2BAA2B,QAAQ,mCAAkC;AAE9E;;;;;;CAMC,GACD,OAAO,MA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AAM,IAAI6D,qBAAqB;wBACrCtH,IAAIyD,MAAM,GAAG6D,mBAAmB,CAACtH,IAAIyD,MAAM,CAAC;oBAC9C;gBACF;YACF;YAEA,IAAIwE,UAAU5H,MAAM,EAAE;gBACpB,MAAM5B,QAAQ6D,MAAM,CAAC;oBACnB1D;oBACAW,WAAWwE;oBACXvB,QAAQyF;gBACV;YACF;QACF;IACF,EAAE,OAAOlG,OAAO;QACd3D,kBAAkB;YAAEI;YAAIC;YAASC;YAAgBqD;YAAOjD;YAAYO;YAAKE;QAAU;IACrF;IAEA,IAAIR,iBAAiB,UAAU;QAC7B,OAAO;YAAEP,IAAIqB,YAAYrB,EAAE;QAAC;IAC9B;IAEA,IAAIO,cAAc;QAChB,OAAOJ;IACT;IAEA,qCAAqC;IACrC,6BAA6B;IAC7B,qCAAqC;IAErC,MAAMmC,eAAehD,kBAAkB;QACrCW;QACAsC,OAAO;QACPlC;QACAI,WAAW;QACXK;QACAC;IACF;IAEAuB,aAAarB,KAAK,GAAG9B,GAAGc,QAAQmC,MAAM,CAACrB,UAAU,CAACf,EAAE,EAAEqB,YAAYrB,EAAE;IAEpE,MAAM2C,MAAM,MAAMvC,GAAGwC,KAAK,CAAC7B,UAAU,CAAC8B,SAAS,CAACP;IAEhD,qCAAqC;IACrC,iBAAiB;IACjB,qCAAqC;IAErC,MAAMqH,SAASpK,UAAa;QAC1BU;QACA6C,QAAQ7C,QAAQ8C,OAAO,CAACD,MAAM;QAC9B3C,MAAMwC;QACNtC;QACAI,WAAW;QACXM;IACF;IAEA,OAAO4I;AACT,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../src/upsertRow/index.ts"],"sourcesContent":["import type { LibSQLDatabase } from 'drizzle-orm/libsql'\nimport type { SelectedFields } from 'drizzle-orm/sqlite-core'\nimport type { TypeWithID } from 'payload'\n\nimport { and, desc, eq, isNull, or } from 'drizzle-orm'\n\nimport type { BlockRowToInsert } from '../transform/write/types.js'\nimport type { Args } from './types.js'\n\ntype RelationshipRow = {\n [key: string]: number | string | undefined // For relationship ID columns like categoriesID, moviesID, etc.\n id?: number | string\n locale?: string\n order: number\n parent: number | string // Drizzle table uses 'parent' key\n path: string\n}\n\nimport { buildFindManyArgs } from '../find/buildFindManyArgs.js'\nimport { transform } from '../transform/read/index.js'\nimport { transformForWrite } from '../transform/write/index.js'\nimport { markWrite } from '../utilities/readAfterWrite.js'\nimport { deleteExistingArrayRows } from './deleteExistingArrayRows.js'\nimport { deleteExistingRowsByPath } from './deleteExistingRowsByPath.js'\nimport { handleUpsertError } from './handleUpsertError.js'\nimport { insertArrays } from './insertArrays.js'\nimport { shouldUseOptimizedUpsertRow } from './shouldUseOptimizedUpsertRow.js'\n\n/**\n * If `id` is provided, it will update the row with that ID.\n * If `where` is provided, it will update the row that matches the `where`\n * If neither `id` nor `where` is provided, it will create a new row.\n *\n * adapter function replaces the entire row and does not support partial updates.\n */\nexport const upsertRow = async <T extends Record<string, unknown> | TypeWithID>({\n id,\n adapter,\n collectionSlug,\n data,\n db,\n fields,\n globalSlug,\n ignoreResult,\n // TODO:\n // When we support joins for write operations (create/update) - pass collectionSlug to the buildFindManyArgs\n // Make a new argument in upsertRow.ts and pass the slug from every operation.\n customID,\n joinQuery: _joinQuery,\n operation,\n path = '',\n req,\n select,\n tableName,\n upsertTarget,\n where,\n}: Args): Promise<T> => {\n if (operation === 'create' && !data.createdAt) {\n data.createdAt = new Date().toISOString()\n }\n\n markWrite(adapter)\n\n let insertedRow: Record<string, unknown> = { id }\n if (id && shouldUseOptimizedUpsertRow({ data, fields })) {\n try {\n const transformedForWrite = transformForWrite({\n adapter,\n data,\n enableAtomicWrites: true,\n fields,\n tableName,\n })\n const { row } = transformedForWrite\n const { arraysToPush } = transformedForWrite\n\n const drizzle = db as LibSQLDatabase\n\n // First, handle $push arrays\n\n if (arraysToPush && Object.keys(arraysToPush)?.length) {\n await insertArrays({\n adapter,\n arrays: [arraysToPush],\n db,\n parentRows: [insertedRow],\n uuidMap: {},\n })\n }\n\n // If row.updatedAt is not set, delete it to avoid triggering hasDataToUpdate. `updatedAt` may be explicitly set to null to\n // disable triggering hasDataToUpdate.\n if (typeof row.updatedAt === 'undefined' || row.updatedAt === null) {\n delete row.updatedAt\n }\n\n const hasDataToUpdate = row && Object.keys(row)?.length\n\n // Then, handle regular row update\n if (ignoreResult) {\n if (hasDataToUpdate) {\n // Only update row if there is something to update.\n // Example: if the data only consists of a single $push, calling insertArrays is enough - we don't need to update the row.\n await drizzle\n .update(adapter.tables[tableName])\n .set(row)\n .where(eq(adapter.tables[tableName].id, id))\n }\n return ignoreResult === 'idOnly' ? ({ id } as T) : null\n }\n\n const findManyArgs = buildFindManyArgs({\n adapter,\n depth: 0,\n fields,\n joinQuery: false,\n select,\n tableName,\n })\n\n const findManyKeysLength = Object.keys(findManyArgs).length\n const hasOnlyColumns = Object.keys(findManyArgs.columns || {}).length > 0\n\n if (!hasDataToUpdate) {\n // Nothing to update => just fetch current row and return\n findManyArgs.where = eq(adapter.tables[tableName].id, insertedRow.id)\n\n const doc = await db.query[tableName].findFirst(findManyArgs)\n\n return transform<T>({\n adapter,\n config: adapter.payload.config,\n data: doc,\n fields,\n joinQuery: false,\n tableName,\n })\n }\n\n if (findManyKeysLength === 0 || hasOnlyColumns) {\n // Optimization - No need for joins => can simply use returning(). This is optimal for very simple collections\n // without complex fields that live in separate tables like blocks, arrays, relationships, etc.\n\n const selectedFields: SelectedFields = {}\n if (hasOnlyColumns) {\n for (const [column, enabled] of Object.entries(findManyArgs.columns)) {\n if (enabled) {\n selectedFields[column] = adapter.tables[tableName][column]\n }\n }\n }\n\n const docs = await drizzle\n .update(adapter.tables[tableName])\n .set(row)\n .where(eq(adapter.tables[tableName].id, id))\n .returning(Object.keys(selectedFields).length ? selectedFields : undefined)\n\n return transform<T>({\n adapter,\n config: adapter.payload.config,\n data: docs[0],\n fields,\n joinQuery: false,\n tableName,\n })\n }\n\n // DB Update that needs the result, potentially with joins => need to update first, then find. returning() does not work with joins.\n\n await drizzle\n .update(adapter.tables[tableName])\n .set(row)\n .where(eq(adapter.tables[tableName].id, id))\n\n findManyArgs.where = eq(adapter.tables[tableName].id, insertedRow.id)\n\n const doc = await db.query[tableName].findFirst(findManyArgs)\n\n return transform<T>({\n adapter,\n config: adapter.payload.config,\n data: doc,\n fields,\n joinQuery: false,\n tableName,\n })\n } catch (error) {\n handleUpsertError({ id, adapter, collectionSlug, error, globalSlug, req, tableName })\n }\n }\n // Split out the incoming data into the corresponding:\n // base row, locales, relationships, blocks, and arrays\n const rowToInsert = transformForWrite({\n adapter,\n data,\n enableAtomicWrites: false,\n fields,\n path,\n tableName,\n })\n\n if (customID) {\n rowToInsert.row.id = customID\n }\n\n // First, we insert the main row\n try {\n if (operation === 'update') {\n const target = upsertTarget || adapter.tables[tableName].id\n\n // Check if we only have relationship operations and no main row data to update\n // Exclude timestamp-only updates when we only have relationship operations.\n // Localized field updates live in the `_locales` table, so the main row may only\n // contain timestamps — in that case the parent row's `updatedAt` must still bump.\n const rowKeys = Object.keys(rowToInsert.row)\n const hasLocalizedData = Object.keys(rowToInsert.locales).length > 0\n const hasMainRowData =\n rowKeys.length > 0 &&\n (hasLocalizedData || !rowKeys.every((key) => key === 'updatedAt' || key === 'createdAt'))\n\n if (hasMainRowData) {\n if (id) {\n rowToInsert.row.id = id\n ;[insertedRow] = await adapter.insert({\n db,\n onConflictDoUpdate: { set: rowToInsert.row, target },\n tableName,\n values: rowToInsert.row,\n })\n } else {\n ;[insertedRow] = await adapter.insert({\n db,\n onConflictDoUpdate: { set: rowToInsert.row, target, where },\n tableName,\n values: rowToInsert.row,\n })\n }\n } else {\n // No main row data to update, just use the existing ID\n insertedRow = { id }\n }\n } else {\n if (adapter.allowIDOnCreate && data.id) {\n rowToInsert.row.id = data.id\n }\n ;[insertedRow] = await adapter.insert({\n db,\n tableName,\n values: rowToInsert.row,\n })\n }\n\n const localesToInsert: Record<string, unknown>[] = []\n const relationsToInsert: Record<string, unknown>[] = []\n const textsToInsert: Record<string, unknown>[] = []\n const numbersToInsert: Record<string, unknown>[] = []\n const blocksToInsert: { [blockType: string]: BlockRowToInsert[] } = {}\n const selectsToInsert: { [selectTableName: string]: Record<string, unknown>[] } = {}\n\n // If there are locale rows with data, add the parent and locale to each\n if (Object.keys(rowToInsert.locales).length > 0) {\n Object.entries(rowToInsert.locales).forEach(([locale, localeRow]) => {\n localeRow._parentID = insertedRow.id\n localeRow._locale = locale\n localesToInsert.push(localeRow)\n })\n }\n\n // If there are relationships, add parent to each\n if (rowToInsert.relationships.length > 0) {\n rowToInsert.relationships.forEach((relation) => {\n relation.parent = insertedRow.id\n relationsToInsert.push(relation)\n })\n }\n\n // If there are texts, add parent to each\n if (rowToInsert.texts.length > 0) {\n rowToInsert.texts.forEach((textRow) => {\n textRow.parent = insertedRow.id\n textsToInsert.push(textRow)\n })\n }\n\n // If there are numbers, add parent to each\n if (rowToInsert.numbers.length > 0) {\n rowToInsert.numbers.forEach((numberRow) => {\n numberRow.parent = insertedRow.id\n numbersToInsert.push(numberRow)\n })\n }\n\n // If there are selects, add parent to each, and then\n // store by table name and rows\n if (Object.keys(rowToInsert.selects).length > 0) {\n Object.entries(rowToInsert.selects).forEach(([selectTableName, selectRows]) => {\n selectsToInsert[selectTableName] = []\n\n selectRows.forEach((row) => {\n if (typeof row.parent === 'undefined') {\n row.parent = insertedRow.id\n }\n\n selectsToInsert[selectTableName].push(row)\n })\n })\n }\n\n // If there are blocks, add parent to each, and then\n // store by table name and rows\n Object.keys(rowToInsert.blocks).forEach((tableName) => {\n rowToInsert.blocks[tableName].forEach((blockRow) => {\n blockRow.row._parentID = insertedRow.id\n if (!blocksToInsert[tableName]) {\n blocksToInsert[tableName] = []\n }\n if (blockRow.row.uuid) {\n delete blockRow.row.uuid\n }\n blocksToInsert[tableName].push(blockRow)\n })\n })\n\n // //////////////////////////////////\n // INSERT LOCALES\n // //////////////////////////////////\n\n if (localesToInsert.length > 0) {\n const localeTableName = `${tableName}${adapter.localesSuffix}`\n const localeTable = adapter.tables[`${tableName}${adapter.localesSuffix}`]\n\n if (operation === 'update') {\n await adapter.deleteWhere({\n db,\n tableName: localeTableName,\n where: eq(localeTable._parentID, insertedRow.id),\n })\n }\n\n await adapter.insert({\n db,\n tableName: localeTableName,\n values: localesToInsert,\n })\n }\n\n // //////////////////////////////////\n // INSERT RELATIONSHIPS\n // //////////////////////////////////\n\n const relationshipsTableName = `${tableName}${adapter.relationshipsSuffix}`\n\n if (operation === 'update') {\n // Filter out specific item deletions (those with itemToRemove) from general path deletions\n const generalRelationshipDeletes = rowToInsert.relationshipsToDelete.filter(\n (rel) => !('itemToRemove' in rel),\n )\n\n await deleteExistingRowsByPath({\n adapter,\n db,\n localeColumnName: 'locale',\n parentColumnName: 'parent',\n parentID: insertedRow.id,\n pathColumnName: 'path',\n rows: [...relationsToInsert, ...generalRelationshipDeletes],\n tableName: relationshipsTableName,\n })\n }\n\n if (relationsToInsert.length > 0) {\n await adapter.insert({\n db,\n tableName: relationshipsTableName,\n values: relationsToInsert,\n })\n }\n\n // //////////////////////////////////\n // HANDLE RELATIONSHIP $push OPERATIONS\n // //////////////////////////////////\n\n if (rowToInsert.relationshipsToAppend.length > 0) {\n // Prepare all relationships for batch insert (order will be set after max query)\n const relationshipsToInsert = rowToInsert.relationshipsToAppend.map((rel) => {\n const parentId = id || insertedRow.id\n const row: Record<string, unknown> = {\n parent: parentId as number | string, // Use 'parent' key for Drizzle table\n path: rel.path,\n }\n\n // Only add locale if this relationship table has a locale column\n const relationshipTable = adapter.rawTables[relationshipsTableName]\n if (rel.locale && relationshipTable && relationshipTable.columns.locale) {\n row.locale = rel.locale\n }\n\n if (rel.relationTo) {\n // Use camelCase key for Drizzle table (e.g., categoriesID not categories_id)\n row[`${rel.relationTo}ID`] = rel.value\n }\n\n return row\n })\n\n if (relationshipsToInsert.length > 0) {\n // Check for potential duplicates\n const relationshipTable = adapter.tables[relationshipsTableName]\n\n if (relationshipTable) {\n // Build conditions only if we have relationships to check\n if (relationshipsToInsert.length === 0) {\n return // No relationships to insert\n }\n\n const conditions = relationshipsToInsert.map((row: RelationshipRow) => {\n const parts = [\n eq(relationshipTable.parent, row.parent),\n eq(relationshipTable.path, row.path),\n ]\n\n // Add locale condition\n if (row.locale !== undefined && relationshipTable.locale) {\n parts.push(eq(relationshipTable.locale, row.locale))\n } else if (relationshipTable.locale) {\n parts.push(isNull(relationshipTable.locale))\n }\n\n // Add all relationship ID matches using schema fields\n for (const [key, value] of Object.entries(row)) {\n if (key.endsWith('ID') && value != null) {\n const column = relationshipTable[key]\n if (column && typeof column === 'object') {\n parts.push(eq(column, value))\n }\n }\n }\n\n return and(...parts)\n })\n\n // Get both existing relationships AND max order in a single query\n let existingRels: Record<string, unknown>[] = []\n let maxOrder = 0\n\n if (conditions.length > 0) {\n // Query for existing relationships\n existingRels = await (db as any)\n .select()\n .from(relationshipTable)\n .where(or(...conditions))\n }\n\n // Get max order for this parent across all paths in a single query\n const parentId = id || insertedRow.id\n const maxOrderResult = await (db as any)\n .select({ maxOrder: relationshipTable.order })\n .from(relationshipTable)\n .where(eq(relationshipTable.parent, parentId))\n .orderBy(desc(relationshipTable.order))\n .limit(1)\n\n if (maxOrderResult.length > 0 && maxOrderResult[0].maxOrder) {\n maxOrder = maxOrderResult[0].maxOrder\n }\n\n // Set order values for all relationships based on max order\n relationshipsToInsert.forEach((row, index) => {\n row.order = maxOrder + index + 1\n })\n\n // Filter out relationships that already exist\n const relationshipsToActuallyInsert = relationshipsToInsert.filter((newRow) => {\n return !existingRels.some((existingRow: Record<string, unknown>) => {\n // Check if this relationship already exists\n let matches = existingRow.parent === newRow.parent && existingRow.path === newRow.path\n\n if (newRow.locale !== undefined) {\n matches = matches && existingRow.locale === newRow.locale\n }\n\n // Check relationship value matches - convert to camelCase for comparison\n for (const key of Object.keys(newRow)) {\n if (key.endsWith('ID')) {\n // Now using camelCase keys\n matches = matches && existingRow[key] === newRow[key]\n }\n }\n\n return matches\n })\n })\n\n // Insert only non-duplicate relationships\n if (relationshipsToActuallyInsert.length > 0) {\n await adapter.insert({\n db,\n tableName: relationshipsTableName,\n values: relationshipsToActuallyInsert,\n })\n }\n }\n }\n }\n\n // //////////////////////////////////\n // HANDLE RELATIONSHIP $remove OPERATIONS\n // //////////////////////////////////\n\n if (rowToInsert.relationshipsToDelete.some((rel) => 'itemToRemove' in rel)) {\n const relationshipTable = adapter.tables[relationshipsTableName]\n\n if (relationshipTable) {\n for (const relToDelete of rowToInsert.relationshipsToDelete) {\n if ('itemToRemove' in relToDelete && relToDelete.itemToRemove) {\n const item = relToDelete.itemToRemove\n const parentId = (id || insertedRow.id) as number | string\n\n const conditions = [\n eq(relationshipTable.parent, parentId),\n eq(relationshipTable.path, relToDelete.path),\n ]\n\n // Add locale condition if this relationship table has a locale column\n if (adapter.rawTables[relationshipsTableName]?.columns.locale) {\n if (relToDelete.locale) {\n conditions.push(eq(relationshipTable.locale, relToDelete.locale))\n } else {\n conditions.push(isNull(relationshipTable.locale))\n }\n }\n\n // Handle polymorphic vs simple relationships\n if (typeof item === 'object' && 'relationTo' in item) {\n // Polymorphic relationship - convert to camelCase key\n const camelKey = `${item.relationTo}ID`\n if (relationshipTable[camelKey]) {\n conditions.push(eq(relationshipTable[camelKey], item.value))\n }\n } else if (relToDelete.relationTo) {\n // Simple relationship - convert to camelCase key\n const camelKey = `${relToDelete.relationTo}ID`\n if (relationshipTable[camelKey]) {\n conditions.push(eq(relationshipTable[camelKey], item))\n }\n }\n\n // Execute DELETE using Drizzle query builder\n await adapter.deleteWhere({\n db,\n tableName: relationshipsTableName,\n where: and(...conditions),\n })\n }\n }\n }\n }\n\n // //////////////////////////////////\n // INSERT hasMany TEXTS\n // //////////////////////////////////\n\n const textsTableName = `${tableName}_texts`\n\n if (operation === 'update') {\n await deleteExistingRowsByPath({\n adapter,\n db,\n localeColumnName: 'locale',\n parentColumnName: 'parent',\n parentID: insertedRow.id,\n pathColumnName: 'path',\n rows: [...textsToInsert, ...rowToInsert.textsToDelete],\n tableName: textsTableName,\n })\n }\n\n if (textsToInsert.length > 0) {\n await adapter.insert({\n db,\n tableName: textsTableName,\n values: textsToInsert,\n })\n }\n\n // //////////////////////////////////\n // INSERT hasMany NUMBERS\n // //////////////////////////////////\n\n const numbersTableName = `${tableName}_numbers`\n\n if (operation === 'update') {\n await deleteExistingRowsByPath({\n adapter,\n db,\n localeColumnName: 'locale',\n parentColumnName: 'parent',\n parentID: insertedRow.id,\n pathColumnName: 'path',\n rows: [...numbersToInsert, ...rowToInsert.numbersToDelete],\n tableName: numbersTableName,\n })\n }\n\n if (numbersToInsert.length > 0) {\n await adapter.insert({\n db,\n tableName: numbersTableName,\n values: numbersToInsert,\n })\n }\n\n // //////////////////////////////////\n // INSERT BLOCKS\n // //////////////////////////////////\n\n const insertedBlockRows: Record<string, Record<string, unknown>[]> = {}\n\n if (operation === 'update') {\n for (const tableName of rowToInsert.blocksToDelete) {\n const blockTable = adapter.tables[tableName]\n await adapter.deleteWhere({\n db,\n tableName,\n where: eq(blockTable._parentID, insertedRow.id),\n })\n }\n }\n\n // When versions are enabled, adapter is used to track mapping between blocks/arrays ObjectID to their numeric generated representation, then we use it for nested to arrays/blocks select hasMany in versions.\n const arraysBlocksUUIDMap: Record<string, number | string> = {}\n\n for (const [tableName, blockRows] of Object.entries(blocksToInsert)) {\n insertedBlockRows[tableName] = await adapter.insert({\n db,\n tableName,\n values: blockRows.map(({ row }) => row),\n })\n\n insertedBlockRows[tableName].forEach((row, i) => {\n blockRows[i].row = row\n if (\n typeof row._uuid === 'string' &&\n (typeof row.id === 'string' || typeof row.id === 'number')\n ) {\n arraysBlocksUUIDMap[row._uuid] = row.id\n }\n })\n\n const blockLocaleIndexMap: number[] = []\n\n const blockLocaleRowsToInsert = blockRows.reduce((acc, blockRow, i) => {\n if (Object.entries(blockRow.locales).length > 0) {\n Object.entries(blockRow.locales).forEach(([blockLocale, blockLocaleData]) => {\n if (Object.keys(blockLocaleData).length > 0) {\n blockLocaleData._parentID = blockRow.row.id\n blockLocaleData._locale = blockLocale\n acc.push(blockLocaleData)\n blockLocaleIndexMap.push(i)\n }\n })\n }\n\n return acc\n }, [])\n\n if (blockLocaleRowsToInsert.length > 0) {\n await adapter.insert({\n db,\n tableName: `${tableName}${adapter.localesSuffix}`,\n values: blockLocaleRowsToInsert,\n })\n }\n\n await insertArrays({\n adapter,\n arrays: blockRows.map(({ arrays }) => arrays),\n db,\n parentRows: insertedBlockRows[tableName],\n uuidMap: arraysBlocksUUIDMap,\n })\n }\n\n // //////////////////////////////////\n // INSERT ARRAYS RECURSIVELY\n // //////////////////////////////////\n\n if (operation === 'update') {\n for (const arrayTableName of Object.keys(rowToInsert.arrays)) {\n await deleteExistingArrayRows({\n adapter,\n db,\n parentID: insertedRow.id,\n tableName: arrayTableName,\n })\n }\n }\n\n await insertArrays({\n adapter,\n arrays: [rowToInsert.arrays, rowToInsert.arraysToPush],\n db,\n parentRows: [insertedRow, insertedRow],\n uuidMap: arraysBlocksUUIDMap,\n })\n\n // //////////////////////////////////\n // INSERT hasMany SELECTS\n // //////////////////////////////////\n\n for (const [selectTableName, tableRows] of Object.entries(selectsToInsert)) {\n const selectTable = adapter.tables[selectTableName]\n if (operation === 'update') {\n await adapter.deleteWhere({\n db,\n tableName: selectTableName,\n where: eq(selectTable.parent, insertedRow.id),\n })\n }\n\n if (Object.keys(arraysBlocksUUIDMap).length > 0) {\n tableRows.forEach((row: RelationshipRow) => {\n if (row.parent in arraysBlocksUUIDMap) {\n row.parent = arraysBlocksUUIDMap[row.parent]\n }\n })\n }\n\n if (tableRows.length) {\n await adapter.insert({\n db,\n tableName: selectTableName,\n values: tableRows,\n })\n }\n }\n } catch (error) {\n handleUpsertError({ id, adapter, collectionSlug, error, globalSlug, req, tableName })\n }\n\n if (ignoreResult === 'idOnly') {\n return { id: insertedRow.id } as T\n }\n\n if (ignoreResult) {\n return data as T\n }\n\n // //////////////////////////////////\n // RETRIEVE NEWLY UPDATED ROW\n // //////////////////////////////////\n\n const findManyArgs = buildFindManyArgs({\n adapter,\n depth: 0,\n fields,\n joinQuery: false,\n select,\n tableName,\n })\n\n findManyArgs.where = eq(adapter.tables[tableName].id, insertedRow.id)\n\n const doc = await db.query[tableName].findFirst(findManyArgs)\n\n // //////////////////////////////////\n // TRANSFORM DATA\n // //////////////////////////////////\n\n const result = transform<T>({\n adapter,\n config: adapter.payload.config,\n data: doc,\n fields,\n joinQuery: false,\n tableName,\n })\n\n return result\n}\n"],"names":["and","desc","eq","isNull","or","buildFindManyArgs","transform","transformForWrite","markWrite","deleteExistingArrayRows","deleteExistingRowsByPath","handleUpsertError","insertArrays","shouldUseOptimizedUpsertRow","upsertRow","id","adapter","collectionSlug","data","db","fields","globalSlug","ignoreResult","customID","joinQuery","_joinQuery","operation","path","req","select","tableName","upsertTarget","where","createdAt","Date","toISOString","insertedRow","transformedForWrite","enableAtomicWrites","row","arraysToPush","drizzle","Object","keys","length","arrays","parentRows","uuidMap","updatedAt","hasDataToUpdate","update","tables","set","findManyArgs","depth","findManyKeysLength","hasOnlyColumns","columns","doc","query","findFirst","config","payload","selectedFields","column","enabled","entries","docs","returning","undefined","error","rowToInsert","target","rowKeys","hasLocalizedData","locales","hasMainRowData","every","key","insert","onConflictDoUpdate","values","allowIDOnCreate","localesToInsert","relationsToInsert","textsToInsert","numbersToInsert","blocksToInsert","selectsToInsert","forEach","locale","localeRow","_parentID","_locale","push","relationships","relation","parent","texts","textRow","numbers","numberRow","selects","selectTableName","selectRows","blocks","blockRow","uuid","localeTableName","localesSuffix","localeTable","deleteWhere","relationshipsTableName","relationshipsSuffix","generalRelationshipDeletes","relationshipsToDelete","filter","rel","localeColumnName","parentColumnName","parentID","pathColumnName","rows","relationshipsToAppend","relationshipsToInsert","map","parentId","relationshipTable","rawTables","relationTo","value","conditions","parts","endsWith","existingRels","maxOrder","from","maxOrderResult","order","orderBy","limit","index","relationshipsToActuallyInsert","newRow","some","existingRow","matches","relToDelete","itemToRemove","item","camelKey","textsTableName","textsToDelete","numbersTableName","numbersToDelete","insertedBlockRows","blocksToDelete","blockTable","arraysBlocksUUIDMap","blockRows","i","_uuid","blockLocaleIndexMap","blockLocaleRowsToInsert","reduce","acc","blockLocale","blockLocaleData","arrayTableName","tableRows","selectTable","result"],"mappings":"AAIA,SAASA,GAAG,EAAEC,IAAI,EAAEC,EAAE,EAAEC,MAAM,EAAEC,EAAE,QAAQ,cAAa;AAcvD,SAASC,iBAAiB,QAAQ,+BAA8B;AAChE,SAASC,SAAS,QAAQ,6BAA4B;AACtD,SAASC,iBAAiB,QAAQ,8BAA6B;AAC/D,SAASC,SAAS,QAAQ,iCAAgC;AAC1D,SAASC,uBAAuB,QAAQ,+BAA8B;AACtE,SAASC,wBAAwB,QAAQ,gCAA+B;AACxE,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,YAAY,QAAQ,oBAAmB;AAChD,SAASC,2BAA2B,QAAQ,mCAAkC;AAE9E;;;;;;CAMC,GACD,OAAO,MAAMC,YAAY,OAAuD,EAC9EC,EAAE,EACFC,OAAO,EACPC,cAAc,EACdC,IAAI,EACJC,EAAE,EACFC,MAAM,EACNC,UAAU,EACVC,YAAY,EACZ,QAAQ;AACR,4GAA4G;AAC5G,8EAA8E;AAC9EC,QAAQ,EACRC,WAAWC,UAAU,EACrBC,SAAS,EACTC,OAAO,EAAE,EACTC,GAAG,EACHC,MAAM,EACNC,SAAS,EACTC,YAAY,EACZC,KAAK,EACA;IACL,IAAIN,cAAc,YAAY,CAACR,KAAKe,SAAS,EAAE;QAC7Cf,KAAKe,SAAS,GAAG,IAAIC,OAAOC,WAAW;IACzC;IAEA3B,UAAUQ;IAEV,IAAIoB,cAAuC;QAAErB;IAAG;IAChD,IAAIA,MAAMF,4BAA4B;QAAEK;QAAME;IAAO,IAAI;QACvD,IAAI;YACF,MAAMiB,sBAAsB9B,kBAAkB;gBAC5CS;gBACAE;gBACAoB,oBAAoB;gBACpBlB;gBACAU;YACF;YACA,MAAM,EAAES,GAAG,EAAE,GAAGF;YAChB,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AErC,MAAMmC,eAAehD,kBAAkB;QACrCW;QACAsC,OAAO;QACPlC;QACAI,WAAW;QACXK;QACAC;IACF;IAEAuB,aAAarB,KAAK,GAAG9B,GAAGc,QAAQmC,MAAM,CAACrB,UAAU,CAACf,EAAE,EAAEqB,YAAYrB,EAAE;IAEpE,MAAM2C,MAAM,MAAMvC,GAAGwC,KAAK,CAAC7B,UAAU,CAAC8B,SAAS,CAACP;IAEhD,qCAAqC;IACrC,iBAAiB;IACjB,qCAAqC;IAErC,MAAMsH,SAASrK,UAAa;QAC1BU;QACA6C,QAAQ7C,QAAQ8C,OAAO,CAACD,MAAM;QAC9B3C,MAAMwC;QACNtC;QACAI,WAAW;QACXM;IACF;IAEA,OAAO6I;AACT,EAAC"}
|
|
@@ -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,GAAU,+CAMhC,IAAI,KAAG,OAAO,CAAC,IAAI,CAgGrB,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,GAAI,mBAGzC;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,EAAE,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,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,GAAI,iDAIxC;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,GAAI,SAAS,OAAO,KAAG,oBAQ1D,CAAA;AAED,eAAO,MAAM,2CAA2C,GAAI,kBAEzD;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,GAAI,kDAIlC;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,GAAI,4BAIjC;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,GAAI,0CAK5B;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,GAAI,MAAM,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,GAAI,MAAM,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,GAAI,yGAOnC;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,GAAI,OAAO,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;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,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,GAAI,iCAAiC,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,GAAI,6BAIlC;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,GAAI,0BAGjC;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,GAAI,MAAM,MAAM,WAIpB,CAAA;AAEf,eAAO,MAAM,oBAAoB,GAAI,2CAKlC,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,GAAI,OAAO,KAAK,KAAG,MAEtD,CAAA"}
|
|
@@ -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,GACvB,SAAS,cAAc,EACvB,IAAI,cAAc,CAAC,SAAS,CAAC,GAAG,kBAAkB,+HAMnD,CAAA"}
|
|
@@ -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,
|
|
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,EAC5E,SAAS,CAAC,EACV,MAAM,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,GAAI,gCAG7B;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,GACpC,OAAO,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,GAAI,QAAQ,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,EACvE,SAAS,cAAc,EACvB,OAAO,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,GAC/B,SAAS,cAAc,EACvB,KAAK,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,GAAI,KAAK,OAAO,EAAE,KAAK,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,GAAU,SAAS,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,GAAI,OAAO,OAAO;;;CAG1C,CAAA;AAEF,eAAO,MAAM,eAAe,GAAI,OAAO,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,GAAI,SAAS,MAAM,KAAG,MAQrD,CAAA"}
|
|
@@ -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;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,QAAQ,CAAA;IACf,YAAY,CAAC,EAAE,QAAQ,CAAA;CACxB,CAAA;AA+DD;;GAEG;AACH,eAAO,MAAM,gCAAgC,
|
|
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;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,QAAQ,CAAA;IACf,YAAY,CAAC,EAAE,QAAQ,CAAA;CACxB,CAAA;AA+DD;;GAEG;AACH,eAAO,MAAM,gCAAgC,GAAI,+DAM9C,IAAI,KAAG,OAwBT,CAAA;AAED,eAAO,MAAM,2BAA2B,eAAwC,CAAA;AAChF,eAAO,MAAM,qBAAqB,GAAI,OAAO,cAAc,EAAE,OAAO,MAAM,SAEzE,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,OAAO,cAAc,EAAE,mBAAmB,MAAM,WAMrF,CAAA"}
|
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.fa345ef",
|
|
4
4
|
"description": "A library of shared functions used by different payload database adapters",
|
|
5
5
|
"homepage": "https://payloadcms.com",
|
|
6
6
|
"repository": {
|
|
@@ -34,11 +34,6 @@
|
|
|
34
34
|
"import": "./dist/exports/sqlite.js",
|
|
35
35
|
"types": "./dist/exports/sqlite.d.ts",
|
|
36
36
|
"default": "./dist/exports/sqlite.js"
|
|
37
|
-
},
|
|
38
|
-
"./types": {
|
|
39
|
-
"import": "./dist/exports/types-deprecated.js",
|
|
40
|
-
"types": "./dist/exports/types-deprecated.d.ts",
|
|
41
|
-
"default": "./dist/exports/types-deprecated.js"
|
|
42
37
|
}
|
|
43
38
|
},
|
|
44
39
|
"main": "./dist/index.js",
|
|
@@ -48,7 +43,7 @@
|
|
|
48
43
|
"mock.js"
|
|
49
44
|
],
|
|
50
45
|
"dependencies": {
|
|
51
|
-
"console-table-printer": "2.
|
|
46
|
+
"console-table-printer": "2.15.0",
|
|
52
47
|
"dequal": "2.0.3",
|
|
53
48
|
"drizzle-orm": "0.45.2",
|
|
54
49
|
"prompts": "2.4.2",
|
|
@@ -60,10 +55,10 @@
|
|
|
60
55
|
"@types/pg": "8.20.0",
|
|
61
56
|
"@types/to-snake-case": "1.0.0",
|
|
62
57
|
"@payloadcms/eslint-config": "3.28.0",
|
|
63
|
-
"payload": "4.0.0-internal.
|
|
58
|
+
"payload": "4.0.0-internal.fa345ef"
|
|
64
59
|
},
|
|
65
60
|
"peerDependencies": {
|
|
66
|
-
"payload": "4.0.0-internal.
|
|
61
|
+
"payload": "4.0.0-internal.fa345ef"
|
|
67
62
|
},
|
|
68
63
|
"scripts": {
|
|
69
64
|
"build": "pnpm build:swc && pnpm build:types",
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import type { BaseRawColumn as _BaseRawColumn, BuildDrizzleTable as _BuildDrizzleTable, BuildQueryJoinAliases as _BuildQueryJoinAliases, ChainedMethods as _ChainedMethods, ColumnToCodeConverter as _ColumnToCodeConverter, CountDistinct as _CountDistinct, CreateJSONQueryArgs as _CreateJSONQueryArgs, DeleteWhere as _DeleteWhere, DrizzleAdapter as _DrizzleAdapter, DrizzleTransaction as _DrizzleTransaction, DropDatabase as _DropDatabase, EnumRawColumn as _EnumRawColumn, Execute as _Execute, GenericColumn as _GenericColumn, GenericColumns as _GenericColumns, GenericPgColumn as _GenericPgColumn, GenericRelation as _GenericRelation, GenericTable as _GenericTable, IDType as _IDType, Insert as _Insert, IntegerRawColumn as _IntegerRawColumn, Migration as _Migration, PostgresDB as _PostgresDB, RawColumn as _RawColumn, RawForeignKey as _RawForeignKey, RawIndex as _RawIndex, RawRelation as _RawRelation, RawTable as _RawTable, RelationMap as _RelationMap, RequireDrizzleKit as _RequireDrizzleKit, SetColumnID as _SetColumnID, SQLiteDB as _SQLiteDB, TimestampRawColumn as _TimestampRawColumn, TransactionPg as _TransactionPg, TransactionSQLite as _TransactionSQLite, UUIDRawColumn as _UUIDRawColumn, VectorRawColumn as _VectorRawColumn } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
4
|
-
*/
|
|
5
|
-
export type BaseRawColumn = _BaseRawColumn;
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
8
|
-
*/
|
|
9
|
-
export type BuildDrizzleTable = _BuildDrizzleTable;
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
12
|
-
*/
|
|
13
|
-
export type BuildQueryJoinAliases = _BuildQueryJoinAliases;
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
16
|
-
*/
|
|
17
|
-
export type ChainedMethods = _ChainedMethods;
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
20
|
-
*/
|
|
21
|
-
export type ColumnToCodeConverter = _ColumnToCodeConverter;
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
24
|
-
*/
|
|
25
|
-
export type CountDistinct = _CountDistinct;
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
28
|
-
*/
|
|
29
|
-
export type CreateJSONQueryArgs = _CreateJSONQueryArgs;
|
|
30
|
-
/**
|
|
31
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
32
|
-
*/
|
|
33
|
-
export type DeleteWhere = _DeleteWhere;
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
36
|
-
*/
|
|
37
|
-
export type DrizzleAdapter = _DrizzleAdapter;
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
40
|
-
*/
|
|
41
|
-
export type DrizzleTransaction = _DrizzleTransaction;
|
|
42
|
-
/**
|
|
43
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
44
|
-
*/
|
|
45
|
-
export type DropDatabase = _DropDatabase;
|
|
46
|
-
/**
|
|
47
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
48
|
-
*/
|
|
49
|
-
export type EnumRawColumn = _EnumRawColumn;
|
|
50
|
-
/**
|
|
51
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
52
|
-
*/
|
|
53
|
-
export type Execute<T> = _Execute<T>;
|
|
54
|
-
/**
|
|
55
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
56
|
-
*/
|
|
57
|
-
export type GenericColumn = _GenericColumn;
|
|
58
|
-
/**
|
|
59
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
60
|
-
*/
|
|
61
|
-
export type GenericColumns<T> = _GenericColumns<T>;
|
|
62
|
-
/**
|
|
63
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
64
|
-
*/
|
|
65
|
-
export type GenericPgColumn = _GenericPgColumn;
|
|
66
|
-
/**
|
|
67
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
68
|
-
*/
|
|
69
|
-
export type GenericRelation = _GenericRelation;
|
|
70
|
-
/**
|
|
71
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
72
|
-
*/
|
|
73
|
-
export type GenericTable = _GenericTable;
|
|
74
|
-
/**
|
|
75
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
76
|
-
*/
|
|
77
|
-
export type IDType = _IDType;
|
|
78
|
-
/**
|
|
79
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
80
|
-
*/
|
|
81
|
-
export type Insert = _Insert;
|
|
82
|
-
/**
|
|
83
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
84
|
-
*/
|
|
85
|
-
export type IntegerRawColumn = _IntegerRawColumn;
|
|
86
|
-
/**
|
|
87
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
88
|
-
*/
|
|
89
|
-
export type Migration = _Migration;
|
|
90
|
-
/**
|
|
91
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
92
|
-
*/
|
|
93
|
-
export type PostgresDB = _PostgresDB;
|
|
94
|
-
/**
|
|
95
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
96
|
-
*/
|
|
97
|
-
export type RawColumn = _RawColumn;
|
|
98
|
-
/**
|
|
99
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
100
|
-
*/
|
|
101
|
-
export type RawForeignKey = _RawForeignKey;
|
|
102
|
-
/**
|
|
103
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
104
|
-
*/
|
|
105
|
-
export type RawIndex = _RawIndex;
|
|
106
|
-
/**
|
|
107
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
108
|
-
*/
|
|
109
|
-
export type RawRelation = _RawRelation;
|
|
110
|
-
/**
|
|
111
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
112
|
-
*/
|
|
113
|
-
export type RawTable = _RawTable;
|
|
114
|
-
/**
|
|
115
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
116
|
-
*/
|
|
117
|
-
export type RelationMap = _RelationMap;
|
|
118
|
-
/**
|
|
119
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
120
|
-
*/
|
|
121
|
-
export type RequireDrizzleKit = _RequireDrizzleKit;
|
|
122
|
-
/**
|
|
123
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
124
|
-
*/
|
|
125
|
-
export type SetColumnID = _SetColumnID;
|
|
126
|
-
/**
|
|
127
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
128
|
-
*/
|
|
129
|
-
export type SQLiteDB = _SQLiteDB;
|
|
130
|
-
/**
|
|
131
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
132
|
-
*/
|
|
133
|
-
export type TimestampRawColumn = _TimestampRawColumn;
|
|
134
|
-
/**
|
|
135
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
136
|
-
*/
|
|
137
|
-
export type TransactionPg = _TransactionPg;
|
|
138
|
-
/**
|
|
139
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
140
|
-
*/
|
|
141
|
-
export type TransactionSQLite = _TransactionSQLite;
|
|
142
|
-
/**
|
|
143
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
144
|
-
*/
|
|
145
|
-
export type UUIDRawColumn = _UUIDRawColumn;
|
|
146
|
-
/**
|
|
147
|
-
* @deprecated - import from `@payloadcms/drizzle` instead
|
|
148
|
-
*/
|
|
149
|
-
export type VectorRawColumn = _VectorRawColumn;
|
|
150
|
-
//# sourceMappingURL=types-deprecated.d.ts.map
|