Documentation
¶
Index ¶
- func TryResolveExpressionEarly(ctx context.Context, schema *proto.Schema, model *proto.Model, ...) (canResolveInMemory bool, resolvedValue bool)
- type OperandResolver
- func (resolver *OperandResolver) GetOperandType() (proto.Type, error)
- func (resolver *OperandResolver) IsContextDbColumn() bool
- func (resolver *OperandResolver) IsContextField() bool
- func (resolver *OperandResolver) IsExplicitInput() bool
- func (resolver *OperandResolver) IsImplicitInput() bool
- func (resolver *OperandResolver) IsLiteral() bool
- func (resolver *OperandResolver) IsModelDbColumn() bool
- func (resolver *OperandResolver) NormalisedFragments() ([]string, error)
- func (resolver *OperandResolver) ResolveValue(args map[string]any) (any, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TryResolveExpressionEarly ¶
func TryResolveExpressionEarly(ctx context.Context, schema *proto.Schema, model *proto.Model, action *proto.Action, expression *parser.Expression, args map[string]any) (canResolveInMemory bool, resolvedValue bool)
TryResolveExpressionEarly attempts to evaluate the expression in the runtime process without generating a row-based query against the database.
Types ¶
type OperandResolver ¶
type OperandResolver struct {
Context context.Context
Schema *proto.Schema
Model *proto.Model
Action *proto.Action
// contains filtered or unexported fields
}
OperandResolver hides some of the complexity of expression parsing so that the runtime action code can reason about and execute expression logic without stepping through the AST.
func NewOperandResolver ¶
func (*OperandResolver) GetOperandType ¶
func (resolver *OperandResolver) GetOperandType() (proto.Type, error)
GetOperandType returns the equivalent protobuf type for the expression operand.
func (*OperandResolver) IsContextDbColumn ¶ added in v0.369.1
func (resolver *OperandResolver) IsContextDbColumn() bool
IsContextDbColumn returns true if the expression refers to a value on the context which will require database access (such as with identity backlinks), such as: @permission(expression: ctx.identity.user.isActive)