Documentation
¶
Overview ¶
Package spi provides Service Provider Interface types for dialect clause handlers to interact with the parser without circular dependencies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClauseHandler ¶
ClauseHandler parses a dialect-specific clause. Called AFTER the clause keyword has been consumed. Returns the parsed node or an error.
type FromItemHandler ¶
FromItemHandler parses a dialect-specific FROM clause item (e.g., PIVOT, UNPIVOT). Called AFTER the keyword has been consumed. The sourceTable parameter is the already-parsed left-hand table.
type GroupByAllMarker ¶
type GroupByAllMarker interface {
IsGroupByAll() bool
}
GroupByAllMarker is an interface to identify GROUP BY ALL markers from dialect handlers. Implement this interface in dialect-specific marker types.
type InfixHandler ¶
InfixHandler parses a dialect-specific infix operator. Called AFTER the operator has been consumed. left is the already-parsed left operand.
type Node ¶
type Node interface{}
Node is the parsed result (opaque to allow returning slices and markers). Handlers can return core.Node implementations, slices, or marker types.
type OrderByAllMarker ¶
OrderByAllMarker is an interface to identify ORDER BY ALL markers from dialect handlers. Implement this interface in dialect-specific marker types.
type ParserOps ¶
type ParserOps interface {
// Token access
Token() token.Token
Peek() token.Token
// Consumption
Match(t token.TokenType) bool
Expect(t token.TokenType) error
NextToken()
Check(t token.TokenType) bool
// Sub-parsers
ParseExpression() (core.Expr, error)
ParseExpressionList() ([]core.Expr, error)
ParseOrderByList() ([]core.OrderByItem, error)
ParseIdentifier() (string, error)
// Error handling
AddError(msg string)
Position() token.Position
}
ParserOps exposes parser operations to dialect clause handlers. This interface allows dialect-specific code to interact with the parser without creating circular dependencies.
type PrefixHandler ¶
PrefixHandler parses a dialect-specific prefix operator. Called AFTER the operator has been consumed.
type StarModifierHandler ¶
type StarModifierHandler func(p ParserOps) (core.StarModifier, error)
StarModifierHandler parses a dialect-specific star modifier (e.g., EXCLUDE, REPLACE, RENAME). Called AFTER the modifier keyword has been consumed. Returns the parsed modifier or an error.