/** * Database Introspection Service * Provides methods to introspect database schema and objects */ import type { TArray, TNullable } from '../types'; import type { Client } from 'pg'; export interface ITableInfo { table_name: string; table_type: string; table_schema: string; table_comment: string; } export interface IColumnInfo { column_name: string; ordinal_position: number; column_default: string | null; is_nullable: string; data_type: string; character_maximum_length: number | null; character_octet_length: number | null; numeric_precision: number | null; numeric_scale: number | null; datetime_precision: number | null; interval_type: string | null; udt_name: string; is_identity: string; identity_generation: string | null; identity_start: string | null; identity_increment: string | null; identity_maximum: string | null; identity_minimum: string | null; identity_cycle: string | null; is_generated: string; generation_expression: string | null; column_comment: string; } export interface IConstraintInfo { constraint_name: string; constraint_type: string; table_name: string; table_schema: string; column_names: string | null; foreign_table_name: string | null; foreign_column_name: string | null; update_rule: string | null; delete_rule: string | null; check_clause: string | null; is_deferrable: string | null; initially_deferred: string | null; } export interface IIndexInfo { indexname: string; tablename: string; schemaname: string; indexdef: string; index_type: string; estimated_rows: number; index_size: string; index_pages: number; is_unique: boolean; is_primary: boolean; } export interface IFunctionInfo { function_name: string; routine_type: string; function_body: string; language_oid: number; language_name: string; volatility: string; security_definer: boolean; is_strict: boolean; returns_set: boolean; cost: number; estimated_rows: number; return_type: string; arguments: string; full_definition: string; function_comment: string; } export interface IFunctionParameterInfo { specific_name: string; parameter_name: string; data_type: string; parameter_mode: string; parameter_default: string | null; ordinal_position: number; function_name: string; } export interface ITriggerInfo { trigger_name: string; event_manipulation: string; event_object_table: string; event_object_schema: string; action_timing: string; action_orientation: string; action_condition: string | null; action_statement: string; action_order: number | null; full_definition: string; trigger_comment: string; } export interface ISchemaInfo { schema_name: string; schema_owner: string; schema_comment: string; } export interface ISequenceInfo { sequence_name: string; data_type: string; start_value: string; minimum_value: string; maximum_value: string; increment: string; cycle_option: 'YES' | 'NO'; sequence_schema: string; sequence_comment: string; } export interface IDatabaseInfo { version: string; database_name: string; current_user: string; session_user: string; server_address: string | null; server_port: number | null; } export declare class IntrospectionService { private client; private schema; constructor(client: Client, schema?: string); /** * Get all tables in the schema */ getTables(): Promise>; /** * Get all sequences in the schema */ getSequences(): Promise>; /** * Get all columns for a specific table */ getTableColumns(tableName: string): Promise>; /** * Get all constraints for a specific table */ getTableConstraints(tableName: string): Promise>; /** * Get all indexes for a specific table */ getTableIndexes(tableName: string): Promise>; /** * Get all functions and procedures in the schema */ getFunctions(): Promise>; /** * Get function parameters for all functions in the schema */ getFunctionParameters(): Promise>; /** * Get all triggers in the schema */ getTriggers(): Promise>; /** * Get schema information */ getSchemaInfo(): Promise>; /** * Get database information */ getDatabaseInfo(): Promise; /** * Get complete table information including columns, constraints, and indexes */ getCompleteTableInfo(tableName: string): Promise<{ table: ITableInfo; columns: TArray; constraints: TArray; indexes: TArray; }>; /** * Check if the schema exists in the database */ checkSchemaExists(): Promise; /** * Get list of available schemas in the database */ getAvailableSchemas(): Promise>; /** * Get all tables with their complete information */ getAllTablesComplete(): Promise; constraints: TArray; indexes: TArray; sequences: TArray; }>>; } //# sourceMappingURL=introspection.d.ts.map