Documentation
¶
Index ¶
- Variables
- func ConvertInt(value any) (any, error)
- func ConvertInt64(value any) (any, error)
- type ColumnResolver
- type Converter
- type Env
- type EnvOption
- type Error
- type Field
- func Any(options ...FieldOption) Field
- func Bool(options ...FieldOption) Field
- func Bytes(options ...FieldOption) Field
- func Double(options ...FieldOption) Field
- func Int(options ...FieldOption) Field
- func Relation(config RelationConfig) Field
- func String(options ...FieldOption) Field
- func Time(options ...FieldOption) Field
- type FieldOption
- type JoinColumns
- type Operator
- type PredicateBuilder
- type PredicateFunc
- type RelationConfig
- type Schema
Constants ¶
This section is empty.
Variables ¶
var ( ErrEmptyFilter = errors.New("empty filter") ErrUnknownField = errors.New("unknown field") ErrUnsupportedOperator = errors.New("unsupported operator") ErrUnsupportedExpression = errors.New("unsupported expression") ErrInvalidLiteral = errors.New("invalid literal") ErrUnknownRelation = errors.New("unknown relation") ErrInvalidRelationFilter = errors.New("invalid relation filter") ErrConvertValue = errors.New("convert value") )
Functions ¶
func ConvertInt ¶
func ConvertInt64 ¶
Types ¶
type ColumnResolver ¶
ColumnResolver resolves a field to an entgo SQL column expression for a selector.
type Converter ¶
Converter converts a CEL literal into the value used by the SQL predicate.
func ConvertTime ¶
type EnvOption ¶
type EnvOption func(*Env)
func AllowEmptyFilter ¶
func AllowEmptyFilter() EnvOption
type Error ¶
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
Field describes a queryable CEL field or relation.
func Double ¶
func Double(options ...FieldOption) Field
Double declares a double-precision numeric field.
func Relation ¶
func Relation(config RelationConfig) Field
type FieldOption ¶
type FieldOption func(*Field)
FieldOption configures a Field constructor.
func Column ¶
func Column(name string) FieldOption
Column maps a field to a selector-qualified SQL column name.
func ColumnExpr ¶
func ColumnExpr(resolver ColumnResolver) FieldOption
ColumnExpr maps a field to a custom SQL column expression.
func Convert ¶
func Convert(converter Converter) FieldOption
Convert configures a field literal converter.
func Predicate ¶
func Predicate(builder PredicateBuilder) FieldOption
Predicate configures a custom SQL predicate builder for a field.
type JoinColumns ¶
type Operator ¶
type Operator string
const ( OperatorEQ Operator = "eq" OperatorNEQ Operator = "neq" OperatorLT Operator = "lt" OperatorLTE Operator = "lte" OperatorGT Operator = "gt" OperatorGTE Operator = "gte" OperatorIn Operator = "in" OperatorContains Operator = "contains" OperatorStartsWith Operator = "startsWith" OperatorEndsWith Operator = "endsWith" )
type PredicateBuilder ¶
PredicateBuilder adds a custom SQL predicate for a field and operator.
Predicate builders should be deterministic and limited to the current selector, with no remote calls or repository lookups.
type PredicateFunc ¶
type RelationConfig ¶
type RelationConfig struct {
Table string
Join JoinColumns
Schema Schema
}