Documentation
¶
Overview ¶
Package database provides the domain service for external database introspection (schema, queries, activity). The repository interfaces define what the service needs from a query executor and query memory store.
Index ¶
- type QueryExecutor
- type QueryResult
- type SchemaResult
- type Service
- func (s *Service) Activity(ctx context.Context, query string) (*SchemaResult, error)
- func (s *Service) Explain(ctx context.Context, query string) (*SchemaResult, error)
- func (s *Service) Schema(ctx context.Context, query string) (*SchemaResult, error)
- func (s *Service) Tables(ctx context.Context, query string) (*SchemaResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type QueryExecutor ¶
type QueryExecutor interface {
ExecuteReadQuery(ctx context.Context, query string) (*QueryResult, error)
}
QueryExecutor runs read-only SQL against an external data source. Implemented by connector.QueryExecutor in production.
type QueryResult ¶
QueryResult holds structured results from a read-only SQL query.
type SchemaResult ¶
type SchemaResult struct {
Columns []string `json:"columns"`
Rows [][]any `json:"rows"`
RowCount int `json:"row_count"`
}
SchemaResult holds the output of a schema introspection query.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides external database introspection (schema, queries, activity).
func NewService ¶
func NewService(exec QueryExecutor) *Service
NewService creates a database service.
Click to show internal directories.
Click to hide internal directories.