feat: add cross-database entity lookup for searching column values across all databases
Enables searching for a specific column value (e.g. carrier_id=123) across all databases on a PostgreSQL server. The backend creates temporary connection pools per database (semaphore-limited to 5), queries information_schema for matching columns, and executes read-only SELECTs with real-time progress events. Results are grouped by database/table in a new "Entity Lookup" tab. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -216,15 +216,67 @@ export interface SavedQuery {
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export type TabType = "query" | "table" | "structure" | "roles" | "sessions";
|
||||
export interface AiSettings {
|
||||
ollama_url: string;
|
||||
model: string;
|
||||
}
|
||||
|
||||
export interface OllamaModel {
|
||||
name: string;
|
||||
}
|
||||
|
||||
// Entity Lookup
|
||||
export interface LookupTableMatch {
|
||||
schema: string;
|
||||
table: string;
|
||||
column_type: string;
|
||||
columns: string[];
|
||||
types: string[];
|
||||
rows: unknown[][];
|
||||
row_count: number;
|
||||
total_count: number;
|
||||
}
|
||||
|
||||
export interface LookupDatabaseResult {
|
||||
database: string;
|
||||
tables: LookupTableMatch[];
|
||||
error: string | null;
|
||||
search_time_ms: number;
|
||||
}
|
||||
|
||||
export interface EntityLookupResult {
|
||||
column_name: string;
|
||||
value: string;
|
||||
databases: LookupDatabaseResult[];
|
||||
total_databases_searched: number;
|
||||
total_tables_matched: number;
|
||||
total_rows_found: number;
|
||||
total_time_ms: number;
|
||||
}
|
||||
|
||||
export interface LookupProgress {
|
||||
lookup_id: string;
|
||||
database: string;
|
||||
status: string;
|
||||
tables_found: number;
|
||||
rows_found: number;
|
||||
error: string | null;
|
||||
completed: number;
|
||||
total: number;
|
||||
}
|
||||
|
||||
export type TabType = "query" | "table" | "structure" | "roles" | "sessions" | "lookup";
|
||||
|
||||
export interface Tab {
|
||||
id: string;
|
||||
type: TabType;
|
||||
title: string;
|
||||
connectionId: string;
|
||||
database?: string;
|
||||
schema?: string;
|
||||
table?: string;
|
||||
sql?: string;
|
||||
roleName?: string;
|
||||
lookupColumn?: string;
|
||||
lookupValue?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user