{"version":3,"sources":["../src/backend/table-names.ts"],"names":["createSqlSchema"],"mappings":";;;;;AAiBO,IAAM,4BAAA,GAA+B;AAE5C,SAAS,0BACP,QAAA,EACwB;AACxB,EAAA,IAAI,QAAA,KAAa,MAAA,EAAW,OAAO,EAAC;AACpC,EAAA,OAAO,MAAA,CAAO,WAAA;AAAA,IACZ,MAAA,CAAO,OAAA,CAAQ,QAAQ,CAAA,CAAE,MAAA,CAAO,CAAC,GAAG,SAAS,CAAA,KAAM,SAAA,KAAc,MAAS;AAAA,GAC5E;AACF;AAYO,SAAS,kBAAA,CACd,SACA,QAAA,EACuB;AACvB,EAAA,OAAOA,iCAAA,CAAgB;AAAA,IACrB,GAAG,OAAA,CAAQ,UAAA;AAAA,IACX,GAAG,0BAA0B,QAAQ;AAAA,GACtC,CAAA,CAAE,MAAA;AACL","file":"chunk-EACDHXJL.cjs","sourcesContent":["/**\n * The one owner of \"which physical relations does this offline operation\n * touch?\" for the maintenance entrypoints that accept a `tableNames` override.\n */\nimport {\n  createSqlSchema,\n  type ResolvedSqlTableNames,\n  type SqlTableNames,\n} from \"../query/compiler/schema\";\nimport type { GraphBackend } from \"./types\";\n\n/**\n * Physical name of the legacy single shared embeddings table, dropped in\n * the cross-backend vector cutover (the clean cut of #157). Strategies now\n * own per-`(nodeKind, fieldPath)` typed storage. Retained only so the\n * one-time migration utility can address and drain the old table.\n */\nexport const LEGACY_EMBEDDINGS_TABLE_NAME = \"typegraph_node_embeddings\";\n\nfunction definedTableNameOverrides(\n  override: Partial<SqlTableNames> | undefined,\n): Partial<SqlTableNames> {\n  if (override === undefined) return {};\n  return Object.fromEntries(\n    Object.entries(override).filter(([, tableName]) => tableName !== undefined),\n  );\n}\n\n/**\n * Resolves the relations an offline maintenance call targets.\n *\n * An override is a PATCH over the backend's own names. This matches the\n * `Partial<SqlTableNames>` input contract: naming only `nodes`, for example,\n * must not silently retarget edges and recorded relations to the built-in\n * defaults. `migrateLegacyRecordedTime` and\n * `repairInvertedValidityWindows` share this owner so an offline write can never\n * resolve the same partial override two different ways.\n */\nexport function resolvedTableNames(\n  backend: Pick<GraphBackend, \"tableNames\">,\n  override: Partial<SqlTableNames> | undefined,\n): ResolvedSqlTableNames {\n  return createSqlSchema({\n    ...backend.tableNames,\n    ...definedTableNameOverrides(override),\n  }).tables;\n}\n"]}