Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnInfo ¶
ColumnInfo represents information about a database column
type ConstraintInfo ¶
type ConstraintInfo struct { Name string Type string Table string Columns []string ReferencedTable string ReferencedColumns []string }
ConstraintInfo represents information about a database constraint
type Database ¶
type Database interface { Query(ctx context.Context, query string, args ...interface{}) (Rows, error) Exec(ctx context.Context, statement string, args ...interface{}) (Result, error) Begin(ctx context.Context, opts *TxOptions) (Tx, error) }
Database represents a database connection and operations
type DatabaseRepository ¶
type DatabaseRepository interface { GetDatabase(id string) (Database, error) ListDatabases() []string GetDatabaseType(id string) (string, error) }
DatabaseRepository defines methods for managing database connections
type PerformanceAnalyzer ¶
type PerformanceAnalyzer interface { GetSlowQueries(limit int) ([]SlowQuery, error) GetMetrics() (PerformanceMetrics, error) AnalyzeQuery(query string) (QueryAnalysis, error) Reset() error SetThreshold(threshold int) error }
PerformanceAnalyzer for analyzing database query performance
type PerformanceMetrics ¶
type PerformanceMetrics struct { TotalQueries int AvgDuration float64 MaxDuration float64 SlowQueries int Threshold int LastResetTime string }
PerformanceMetrics represents database performance metrics
type QueryAnalysis ¶
QueryAnalysis represents the analysis of a SQL query
type Rows ¶
type Rows interface { Close() error Columns() ([]string, error) Next() bool Scan(dest ...interface{}) error Err() error }
Rows represents database query results
type SchemaInfo ¶
type SchemaInfo interface { GetTables() ([]string, error) GetColumns(table string) ([]ColumnInfo, error) GetIndexes(table string) ([]IndexInfo, error) GetConstraints(table string) ([]ConstraintInfo, error) }
SchemaInfo represents database schema information
Click to show internal directories.
Click to hide internal directories.