Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSQLParser ¶
func NewSQLParser(options ...SQLParserOption) (queryparser.Parser, error)
NewSQLParser initializes and returns a new instance of Parser.
The SQLParser is configured with a set of predefined SQL functions that can be used to construct queries, including logical operations (AND, OR), comparison operators (EQ, NOTEQ, LT, LTE, GT, GTE), and other specialized functions (IN, NOTIN, LIKE, NOTLIKE, ISNULL, ISNOTNULL, CONTAINS, OVERLAPS, etc.).
Types ¶
type FunctionHandler ¶
type FunctionHandler func(args ...any) (*FunctionResult, error)
func Wrap ¶
func Wrap[T any](f func(args ...T) (*FunctionResult, error)) FunctionHandler
Wrap wraps a FunctionHandler and ensures that its arguments are of type T.
type FunctionResult ¶
type SQLParser ¶
type SQLParser struct {
// contains filtered or unexported fields
}
type SQLParserOption ¶
func WithOverrideFunction ¶
func WithOverrideFunction(name string, f FunctionHandler) SQLParserOption
WithOverrideFunction allows you to override an existing SQL function in the SQLParser with a custom implementation.
func WithTokenizer ¶
func WithTokenizer(tokenizer queryparser.Tokenizer) SQLParserOption
WithTokenizer sets a custom tokenizer for the SQLParser. This allows for overriding the default tokenization behavior with a user-provided tokenizer