Documentation
¶
Overview ¶
Package analyzer validates and resolves SQL queries against a schema catalog.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SQLiteTypeToGo ¶
SQLiteTypeToGo is a convenience function that uses default type mapping (kept for backward compatibility where no custom types are needed)
Types ¶
type Analyzer ¶
type Analyzer struct {
Catalog *model.Catalog
CustomTypes map[string]config.CustomTypeMapping
// contains filtered or unexported fields
}
Analyzer validates queries against the schema catalog.
func NewWithCustomTypes ¶
func NewWithCustomTypes(catalog *model.Catalog, customTypes map[string]config.CustomTypeMapping) *Analyzer
NewWithCustomTypes creates a new Analyzer with the given catalog and custom type mappings.
func (*Analyzer) SQLiteTypeToGo ¶
SQLiteTypeToGo converts a SQLite type to a Go type. If a TypeResolver is set, it will be used for database-specific type mapping.
func (*Analyzer) SetTypeResolver ¶
func (a *Analyzer) SetTypeResolver(resolver TypeResolver)
SetTypeResolver sets the type resolver for database-specific type mapping.
type Diagnostic ¶
Diagnostic represents an issue found during analysis.
type Result ¶
type Result struct {
Query parser.Query
Columns []ResultColumn
Params []ResultParam
Diagnostics []Diagnostic
}
Result contains the analysis result for a single query.
type ResultColumn ¶
ResultColumn describes a single output column of a query.
type ResultParam ¶
type ResultParam struct {
Name string
Style parser.ParamStyle
GoType string
Nullable bool
IsVariadic bool
VariadicCount int
}
ResultParam describes a single input parameter of a query.
type TypeResolver ¶
TypeResolver interface for database-specific type mapping.