import type { MaterializedViewDefinition, SchemaDefinition, TableDefinition } from '@chkit/core'; import './table-config.js'; import type { TimeColumnCandidate } from './types.js'; /** * Return every materialized view whose `to` target is `database.table`. * ClickHouse allows several MVs to feed the same destination table, so an * mv_replay backfill must replay all of them — returning only the first would * silently drop the rest. */ export declare function findMvsForTarget(definitions: SchemaDefinition[], database: string, table: string): MaterializedViewDefinition[]; /** * Resolve the single source table an mv_replay backfill should size its chunks * against — the table the materialized views read `FROM`. The injected chunk * conditions (`_partition_id`, sort-key ranges) run against that source, so the * chunk planner must introspect it rather than the target, which is * legitimately empty while a fresh aggregate is being bootstrapped. * * An unqualified `FROM` table defaults to the view's own database, matching * ClickHouse name resolution. Returns `undefined` when a source can't be * resolved to a single shared table — either a `FROM` we can't parse, or MVs * fanning in from different sources (which one chunk plan can't drive) — so the * caller falls back to introspecting the target, preserving multi-source replay. */ export declare function resolveMvReplaySource(mvs: MaterializedViewDefinition[]): { database: string; table: string; } | undefined; export declare function findTableForTarget(definitions: SchemaDefinition[], database: string, table: string): TableDefinition | undefined; export declare function detectCandidatesFromTable(table: TableDefinition): TimeColumnCandidate[]; export declare function extractSchemaTimeColumn(table: TableDefinition): string | undefined; //# sourceMappingURL=detect.d.ts.map