conditionexpr

package
v0.0.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalOperator

func CanonicalOperator(op string) string

CanonicalOperator normalizes alias operators to canonical names.

func ParseNumeric

func ParseNumeric(raw string) (any, error)

ParseNumeric parses a numeric literal into int64 or float64.

func ParseRFC3339OrUnixMs

func ParseRFC3339OrUnixMs(raw string) (time.Time, error)

ParseRFC3339OrUnixMs parses ISO8601 datetime string or unix milliseconds.

Types

type OperatorValue

type OperatorValue struct {
	Operator string
	Value    string
}

OperatorValue contains the parsed operator + value pair from an expression like "op:value".

func ParseOperatorValueEqualsOnEmptyOperator

func ParseOperatorValueEqualsOnEmptyOperator(raw string) OperatorValue

ParseOperatorValueEqualsOnEmptyOperator parses "op:value" while treating empty op as equals. This preserves legacy behavior used by query normalizer.

func ParseOperatorValueLenient

func ParseOperatorValueLenient(raw string) OperatorValue

ParseOperatorValueLenient parses "op:value"; malformed pairs fallback to equals(raw).

func ParseOperatorValueStrict

func ParseOperatorValueStrict(raw string) (OperatorValue, error)

ParseOperatorValueStrict parses "op:value"; malformed pairs return an error.

type SQLOperatorResult

type SQLOperatorResult struct {
	SQLOperator string
	Value       string
}

SQLOperatorResult maps an operator token to SQL syntax and the normalized value.

func ToSQLOperator

func ToSQLOperator(op, value string) (SQLOperatorResult, error)

ToSQLOperator converts a logical operator to SQL syntax. For LIKE operators, it also applies wildcard normalization to value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL