feat: add connection management UI

Add TypeScript types, typed Tauri invoke wrappers, Zustand store,
TanStack Query hooks, and connection components: ConnectionDialog
(create/edit/test), ConnectionList (sheet panel), ConnectionSelector
(toolbar dropdown).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-11 19:06:35 +03:00
parent 9b675babd5
commit 734b84b525
10 changed files with 878 additions and 0 deletions

66
src/types/index.ts Normal file
View File

@@ -0,0 +1,66 @@
export interface ConnectionConfig {
id: string;
name: string;
host: string;
port: number;
user: string;
password: string;
database: string;
ssl_mode?: string;
color?: string;
}
export interface QueryResult {
columns: string[];
types: string[];
rows: unknown[][];
row_count: number;
execution_time_ms: number;
}
export interface PaginatedQueryResult extends QueryResult {
total_rows: number;
page: number;
page_size: number;
}
export interface SchemaObject {
name: string;
object_type: string;
schema: string;
}
export interface ColumnInfo {
name: string;
data_type: string;
is_nullable: boolean;
column_default: string | null;
ordinal_position: number;
character_maximum_length: number | null;
is_primary_key: boolean;
}
export interface ConstraintInfo {
name: string;
constraint_type: string;
columns: string[];
}
export interface IndexInfo {
name: string;
definition: string;
is_unique: boolean;
is_primary: boolean;
}
export type TabType = "query" | "table" | "structure";
export interface Tab {
id: string;
type: TabType;
title: string;
connectionId: string;
schema?: string;
table?: string;
sql?: string;
}