Documentation
¶
Overview ¶
Package sqlcbinding discovers repository-owned sqlc v2 configuration and validates generated Go query methods against canonical handwritten SQL.
Index ¶
- Constants
- func IsBindingInput(filePath string) bool
- func IsConfigPath(filePath string) bool
- func IsSemanticInput(filePath string) bool
- func ResolveTableArgument(argument, statement string, tables []string, dialect string) (string, bool)
- type Binding
- type Config
- type Entry
- type GoConfig
- type Loader
- func (l *Loader) AffectedPaths(root string, changedPaths []string) (queries, configs []string, known bool)
- func (l *Loader) FileSemanticKey(ctx context.Context, input parserapi.Input) (string, error)
- func (l *Loader) Load(ctx context.Context, input parserapi.Input) (Registry, error)
- func (l *Loader) SemanticKey(ctx context.Context, input parserapi.Input) (string, error)
- type Parser
- func (*Parser) IsSemanticInput(path string) bool
- func (*Parser) Language() string
- func (p *Parser) Parse(ctx context.Context, input parserapi.Input) (graph.ParseResult, error)
- func (p *Parser) SemanticAffectedPaths(root string, allPaths, changedPaths []string) []string
- func (p *Parser) SemanticKey(ctx context.Context, input parserapi.Input) (string, error)
- func (*Parser) Supports(path string) bool
- func (*Parser) WorkspaceSemanticEvidenceKey(context.Context, parserapi.Input) (string, error)
- func (p *Parser) WorkspaceSemanticKey(ctx context.Context, input parserapi.Input) (string, error)
- type Query
- type Registry
- func (r Registry) BindingsForQuery(path, name string) []Binding
- func (r Registry) ColumnsForQuery(queryPath, table string) ([]string, bool)
- func (r Registry) Config(path string) (Config, bool)
- func (r Registry) Configs() []Config
- func (r Registry) EntriesForQuery(path string) []Entry
- func (r Registry) EntriesForSQLPath(path string) []Entry
- func (r Registry) Query(path, name string) (Query, bool)
- func (r Registry) SchemaColumnsForQuery(queryPath, table string) (string, []string, bool)
Constants ¶
const (
AdapterVersion = "2"
)
Variables ¶
This section is empty.
Functions ¶
func IsBindingInput ¶
func IsConfigPath ¶
func IsSemanticInput ¶
Types ¶
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
func (*Loader) AffectedPaths ¶
func (l *Loader) AffectedPaths(root string, changedPaths []string) (queries, configs []string, known bool)
AffectedPaths derives the exact config and query files whose binding evidence can change after changedPaths. It consults only a registry already published for root by WorkspaceSemanticKey; callers use the false result as unknown and may fall back conservatively.
func (*Loader) FileSemanticKey ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser owns diagnostics on sqlc configuration files. The SQL router and this parser share a Loader in the production registry, so configuration is parsed once per immutable indexing snapshot.
func (*Parser) IsSemanticInput ¶
func (*Parser) SemanticAffectedPaths ¶
func (*Parser) SemanticKey ¶
func (*Parser) WorkspaceSemanticEvidenceKey ¶
type Registry ¶
type Registry struct {
Digest string
// contains filtered or unexported fields
}
func (Registry) BindingsForQuery ¶
func (Registry) ColumnsForQuery ¶
ColumnsForQuery returns complete, unique configured schema evidence for a table in the binding scopes that own queryPath. Compatible overlapping entries may agree; missing, conflicting, or ambiguous declarations fail closed.