Documentation
¶
Index ¶
- type Adapter
- type PostgresAdapter
- func (p *PostgresAdapter) Close()
- func (p *PostgresAdapter) Connect(connString string) error
- func (p *PostgresAdapter) FetchSchema(g *graph.Graph) error
- func (p *PostgresAdapter) GetColumnDependencies(schema, table, column string) ([]graph.ColumnDependency, error)
- func (p *PostgresAdapter) GetMetrics() (*graph.DBMetrics, error)
- func (p *PostgresAdapter) GetTableDependencies(schema, table string) ([]graph.ColumnDependency, error)
- func (p *PostgresAdapter) GetTopQueries(limit int, sortBy string) ([]graph.QueryStats, error)
- func (p *PostgresAdapter) TraceQuery(query string) (*graph.TraceResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter interface {
Connect(connString string) error
Close()
FetchSchema(g *graph.Graph) error
GetMetrics() (*graph.DBMetrics, error)
GetColumnDependencies(schema, table, column string) ([]graph.ColumnDependency, error)
GetTableDependencies(schema, table string) ([]graph.ColumnDependency, error)
GetTopQueries(limit int, sortBy string) ([]graph.QueryStats, error)
TraceQuery(query string) (*graph.TraceResult, error)
}
Adapter is the interface that all database adapters must implement
func NewAdapter ¶
NewAdapter creates a new adapter based on the connection string scheme
type PostgresAdapter ¶
PostgresAdapter handles PostgreSQL interactions
func NewPostgresAdapter ¶
func NewPostgresAdapter() *PostgresAdapter
NewPostgresAdapter creates a new postgres adapter
func (*PostgresAdapter) Connect ¶
func (p *PostgresAdapter) Connect(connString string) error
Connect establishes a connection to the database
func (*PostgresAdapter) FetchSchema ¶
func (p *PostgresAdapter) FetchSchema(g *graph.Graph) error
FetchSchema queries the database schema and populates the graph
func (*PostgresAdapter) GetColumnDependencies ¶
func (p *PostgresAdapter) GetColumnDependencies(schema, table, column string) ([]graph.ColumnDependency, error)
GetColumnDependencies identifies all objects that depend on a specific column
func (*PostgresAdapter) GetMetrics ¶
func (p *PostgresAdapter) GetMetrics() (*graph.DBMetrics, error)
GetMetrics returns real-time database statistics
func (*PostgresAdapter) GetTableDependencies ¶
func (p *PostgresAdapter) GetTableDependencies(schema, table string) ([]graph.ColumnDependency, error)
GetTableDependencies identifies all objects that depend on a specific table
func (*PostgresAdapter) GetTopQueries ¶
func (p *PostgresAdapter) GetTopQueries(limit int, sortBy string) ([]graph.QueryStats, error)
GetTopQueries fetches the top costly queries from pg_stat_statements
func (*PostgresAdapter) TraceQuery ¶
func (p *PostgresAdapter) TraceQuery(query string) (*graph.TraceResult, error)
TraceQuery executes a query with EXPLAIN (ANALYZE, BUFFERS) and returns performance data