Documentation
¶
Index ¶
- type CustomOperatorHandler
- type CustomOperatorLookup
- type Parser
- func (p *Parser) Parse(logic interface{}) (string, error)
- func (p *Parser) ParseCondition(logic interface{}) (string, error)
- func (p *Parser) ParseConditionParameterized(logic interface{}) (string, []params.QueryParam, error)
- func (p *Parser) ParseParameterized(logic interface{}) (string, []params.QueryParam, error)
- func (p *Parser) SetCustomOperatorLookup(lookup CustomOperatorLookup)
- func (p *Parser) SetSchema(schema operators.SchemaProvider)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomOperatorHandler ¶ added in v1.0.1
CustomOperatorHandler is an interface for custom operator implementations. This mirrors the public OperatorHandler interface.
type CustomOperatorLookup ¶ added in v1.0.1
type CustomOperatorLookup func(operatorName string) (CustomOperatorHandler, bool)
CustomOperatorLookup is a function type for looking up custom operators.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser parses JSON Logic expressions and converts them to SQL WHERE clauses.
func NewParser ¶
func NewParser(config *operators.OperatorConfig) *Parser
NewParser creates a new parser instance with config. If config is nil, defaults to BigQuery dialect for backward compatibility.
func (*Parser) ParseCondition ¶ added in v1.0.3
ParseCondition converts a JSON Logic expression to a SQL condition without the WHERE keyword. This is useful when you need to embed the condition in a larger query.
func (*Parser) ParseConditionParameterized ¶ added in v1.0.9
func (p *Parser) ParseConditionParameterized(logic interface{}) (string, []params.QueryParam, error)
ParseConditionParameterized converts a JSON Logic expression to a SQL condition (without WHERE keyword) with bind parameter placeholders.
func (*Parser) ParseParameterized ¶ added in v1.0.9
func (p *Parser) ParseParameterized(logic interface{}) (string, []params.QueryParam, error)
ParseParameterized converts a JSON Logic expression to a SQL WHERE clause with bind parameter placeholders instead of inlined literals.
func (*Parser) SetCustomOperatorLookup ¶ added in v1.0.1
func (p *Parser) SetCustomOperatorLookup(lookup CustomOperatorLookup)
SetCustomOperatorLookup sets the function used to look up custom operators. This also sets up the validator to recognize custom operators.
func (*Parser) SetSchema ¶ added in v1.0.1
func (p *Parser) SetSchema(schema operators.SchemaProvider)
SetSchema sets the schema provider for field validation and type checking.