jsonfilter

package
v1.35.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildEntSelectorFromJSONFilter

func BuildEntSelectorFromJSONFilter(jsonFilter *JSONFilter) (*entsql.Predicate, error)

BuildEntSelectorFromJSONFilter constructs an Ent SQL predicate for JSON filtering.

Types

type JSONFilter

type JSONFilter struct {
	// Column is the name of the JSON column.
	Column string
	// FieldPath is the path to the field in the JSON object.
	// It's the inner path within the json column. It accepts dot notation.
	// Example:
	// "metadata.name" for {"metadata": {"name": "foo"}}
	FieldPath string
	// Value is the value to compare against.
	Value any
	// Operator is the comparison operator.
	Operator JSONOperator
}

JSONFilter represents a filter for JSON fields.

type JSONOperator

type JSONOperator string

JSONOperator represents supported JSON filter operators.

const (
	OpEQ  JSONOperator = "eq"
	OpNEQ JSONOperator = "neq"
	OpIN  JSONOperator = "in"
)

Jump to

Keyboard shortcuts

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