Documentation
¶
Index ¶
- type ErrorCategory
- type MetadataStore
- func (s *MetadataStore) CreateSavedQuery(ctx context.Context, req SavedQueryUpsertRequest) (*SavedQuery, error)
- func (s *MetadataStore) DeleteSavedQuery(ctx context.Context, id string) error
- func (s *MetadataStore) ListQueryHistory(ctx context.Context, limit, offset int, status string) ([]QueryHistoryEntry, int, error)
- func (s *MetadataStore) ListSavedQueries(ctx context.Context) ([]SavedQuery, error)
- func (s *MetadataStore) RecordQueryHistory(ctx context.Context, entry QueryHistoryEntry) error
- func (s *MetadataStore) UpdateSavedQuery(ctx context.Context, id string, req SavedQueryUpsertRequest) (*SavedQuery, error)
- type QueryAPIError
- type QueryAuditEvent
- type QueryColumn
- type QueryErrorResponse
- type QueryExecutionMeta
- type QueryExecutionResult
- type QueryExecutor
- type QueryExecutorOptions
- type QueryHandler
- func (h *QueryHandler) HandleHistory(w http.ResponseWriter, req *http.Request)
- func (h *QueryHandler) HandleQuery(w http.ResponseWriter, req *http.Request)
- func (h *QueryHandler) HandleSavedQueries(w http.ResponseWriter, req *http.Request)
- func (h *QueryHandler) HandleSavedQueryByID(w http.ResponseWriter, req *http.Request)
- type QueryHandlerOptions
- type QueryHistoryEntry
- type QueryHistoryListResponse
- type QueryRequest
- type QueryResponse
- type SavedQuery
- type SavedQueryListResponse
- type SavedQueryUpsertRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorCategory ¶
type ErrorCategory string
const ( ErrorCategoryValidation ErrorCategory = "validation" ErrorCategoryPermission ErrorCategory = "permission" ErrorCategorySyntax ErrorCategory = "syntax" ErrorCategoryExecution ErrorCategory = "execution" ErrorCategoryTimeout ErrorCategory = "timeout" )
type MetadataStore ¶
type MetadataStore struct {
// contains filtered or unexported fields
}
func NewMetadataStore ¶
func NewMetadataStore(runtime *sqliteapp.Runtime) (*MetadataStore, error)
func (*MetadataStore) CreateSavedQuery ¶
func (s *MetadataStore) CreateSavedQuery(ctx context.Context, req SavedQueryUpsertRequest) (*SavedQuery, error)
func (*MetadataStore) DeleteSavedQuery ¶
func (s *MetadataStore) DeleteSavedQuery(ctx context.Context, id string) error
func (*MetadataStore) ListQueryHistory ¶
func (s *MetadataStore) ListQueryHistory(ctx context.Context, limit, offset int, status string) ([]QueryHistoryEntry, int, error)
func (*MetadataStore) ListSavedQueries ¶
func (s *MetadataStore) ListSavedQueries(ctx context.Context) ([]SavedQuery, error)
func (*MetadataStore) RecordQueryHistory ¶
func (s *MetadataStore) RecordQueryHistory(ctx context.Context, entry QueryHistoryEntry) error
func (*MetadataStore) UpdateSavedQuery ¶
func (s *MetadataStore) UpdateSavedQuery(ctx context.Context, id string, req SavedQueryUpsertRequest) (*SavedQuery, error)
type QueryAPIError ¶
type QueryAPIError struct {
Category ErrorCategory `json:"category"`
Message string `json:"message"`
CorrelationID string `json:"correlation_id"`
}
type QueryAuditEvent ¶
type QueryColumn ¶
type QueryErrorResponse ¶
type QueryErrorResponse struct {
Error QueryAPIError `json:"error"`
}
type QueryExecutionMeta ¶
type QueryExecutionMeta struct {
CorrelationID string `json:"correlation_id"`
DurationMS int64 `json:"duration_ms"`
RowCount int `json:"row_count"`
EffectiveRowLimit int `json:"effective_row_limit"`
PayloadBytes int `json:"payload_bytes"`
PayloadCapBytes int `json:"payload_cap_bytes"`
StatementTimeoutMS int64 `json:"statement_timeout_ms"`
Truncated bool `json:"truncated"`
TruncatedByRowLimit bool `json:"truncated_by_row_limit"`
TruncatedByPayload bool `json:"truncated_by_payload"`
StatementType string `json:"statement_type"`
}
type QueryExecutionResult ¶
type QueryExecutor ¶
type QueryExecutor struct {
// contains filtered or unexported fields
}
func NewQueryExecutor ¶
func NewQueryExecutor(runtime *sqliteapp.Runtime, opts QueryExecutorOptions) (*QueryExecutor, error)
func (*QueryExecutor) Execute ¶
func (q *QueryExecutor) Execute(ctx context.Context, req QueryRequest, correlationID string) (*QueryExecutionResult, error)
type QueryExecutorOptions ¶
type QueryHandler ¶
type QueryHandler struct {
// contains filtered or unexported fields
}
func NewQueryHandler ¶
func NewQueryHandler(executor *QueryExecutor, store *MetadataStore, logger *log.Logger) (*QueryHandler, error)
func (*QueryHandler) HandleHistory ¶
func (h *QueryHandler) HandleHistory(w http.ResponseWriter, req *http.Request)
func (*QueryHandler) HandleQuery ¶
func (h *QueryHandler) HandleQuery(w http.ResponseWriter, req *http.Request)
func (*QueryHandler) HandleSavedQueries ¶
func (h *QueryHandler) HandleSavedQueries(w http.ResponseWriter, req *http.Request)
func (*QueryHandler) HandleSavedQueryByID ¶
func (h *QueryHandler) HandleSavedQueryByID(w http.ResponseWriter, req *http.Request)
type QueryHandlerOptions ¶
type QueryHistoryEntry ¶
type QueryHistoryEntry struct {
ID string `json:"id"`
QueryText string `json:"query_text"`
QueryPreview string `json:"query_preview"`
ParamsJSON string `json:"params_json"`
Status string `json:"status"`
DurationMS int64 `json:"duration_ms"`
RowCount int `json:"row_count"`
ErrorSummary string `json:"error_summary"`
CreatedAt string `json:"created_at"`
}
type QueryHistoryListResponse ¶
type QueryHistoryListResponse struct {
Items []QueryHistoryEntry `json:"items"`
Total int `json:"total"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
type QueryRequest ¶
type QueryRequest struct {
SQL string `json:"sql"`
PositionalParams []any `json:"positional_params,omitempty"`
NamedParams map[string]any `json:"named_params,omitempty"`
RowLimit int `json:"row_limit,omitempty"`
TimeoutMS int `json:"timeout_ms,omitempty"`
AllowMultiStatement bool `json:"allow_multi_statement,omitempty"`
}
type QueryResponse ¶
type QueryResponse struct {
Columns []QueryColumn `json:"columns"`
Rows []map[string]any `json:"rows"`
Meta QueryExecutionMeta `json:"meta"`
}
type SavedQuery ¶
type SavedQuery struct {
ID string `json:"id"`
Name string `json:"name"`
SQL string `json:"sql"`
PositionalParams []any `json:"positional_params,omitempty"`
NamedParams map[string]any `json:"named_params,omitempty"`
SchemaVersion int `json:"schema_version"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type SavedQueryListResponse ¶
type SavedQueryListResponse struct {
Items []SavedQuery `json:"items"`
}
Click to show internal directories.
Click to hide internal directories.