Skip to main content

Module expr

Module expr 

Source
Expand description

Scalar expression evaluator: turns an Expr into a Value under a row context (column -> value) and a parameter binding.

Structs§

CanonicalMultirange
CanonicalRange
CompiledLikePattern
A LIKE/ILIKE pattern compiled once for repeated evaluation.
EvalContext

Enums§

IntegerWidth

Traits§

EngineHook
Engine-side hook that scalar function evaluation calls for stateful sequence and user-defined functions. Query-valued expressions are not accepted here: lowering assigns them physical query-plan slots executed by uqa-execution::ScalarSubqueryRunner.
RowLookup
Read-only row interface used by the expression evaluator. Most callers use a materialised ResultRow, while hot execution paths can expose a projected value slice without rebuilding a string-keyed map for every row.

Functions§

array_dimensions
Return every dimension of a rectangular array value.
array_transform_argument_positions
Map call-order arguments onto the declared array_sort and array_reverse slots. None means the arity or a named argument does not select a catalogued overload.
array_value_to_string
bound_scalar_function_strictness
Return the PostgreSQL 18 strictness contract selected by a structural function binding. Parser-owned syntax and overload-specific built-ins must be classified by FunctionDispatch, never by their diagnostic display label.
builtin_scalar_function_strictness
call_argument_value
Return a call argument’s value expression after stripping named and explicit VARIADIC syntax markers.
cast_value
Cast a value to the named SQL type, mirroring CAST(expr AS ty). Types outside the engine’s coercion surface return SQLError::Unsupported.
cast_value_from
Cast a value while preserving an explicitly declared source type when the runtime carrier erases it. PostgreSQL 18 integer-to-bytea/oid casts and xid cast rejection require the source’s declared identity.
cast_value_with_type_resolution
Cast a value after resolving catalog-owned source and target types and flattening domains to their coercion types.
coercion_type_name
eval
Evaluate a value-producing AST expression against one row and parameter context.
eval_binary_values
Apply a binary SQL operator to values that have already been evaluated. Execution engines use this when a hot path compiles expression traversal ahead of time but must retain the evaluator’s exact comparison, numeric promotion, NULL, overflow, and division-by-zero semantics.
eval_binary_values_with_integer_width
Evaluate an operator while retaining the integer type selected by SQL operator resolution. The dynamic Value carrier stores all integers as i64, so expression plans pass this width alongside the operands.
eval_bound_builtin_function_call
Evaluate a call’s argument list, unwrapping name => value
eval_builtin_function_call
Execute a call whose stored binding selects a built-in routine. Dynamic runtime callbacks and SQL routines must not override this stable binding.
eval_comparison_truth
Compare two values without allocating an intermediate Value::Bool.
eval_function_call
Execute a scalar function after its argument expressions have already been evaluated.
evaluate_call_args
Return the PostgreSQL 18 strictness contract for a built-in scalar call when its implemented overload is known.
format_regtype_value
Format a scalar or array OID carrier using the catalog-aware output function of a reg* type. None means the declared type is not one of the supported alias types or the value is SQL NULL.
integer_width_for_literal
integer_width_for_type
json_strip_nulls_argument_positions
Map call-order arguments onto the declared (target, strip_in_arrays DEFAULT false) slots. None means the arity or a named argument does not select either catalogued overload.
multirange_from_ranges
negate_value
Apply PostgreSQL prefix - while retaining the operand’s declared type.
parse_multirange
parse_pg_array_literal
Parse a PostgreSQL array literal ({1,2,3}, {"a b",NULL}, {{1,2},{3,4}}) into nested lists of string/NULL values; the caller casts elements.
parse_range
parse_uuid_bytes
Parse every UUID input spelling accepted by PostgreSQL into network-order bytes.
quote_ident
quote_ident: double-quote unless the identifier is a safe lower-case name that is not a keyword.
truthy
NULL is falsy; otherwise truthy iff the value coerces to a non-zero boolean / number / non-empty string.
unknown_function_error
function name(arg types) does not exist - the error PostgreSQL raises when call resolution fails (SQLSTATE 42883).
validate_named_argument_order
Enforce PostgreSQL function-call ordering before overload resolution. Positional arguments must precede named arguments, and each explicit name may occur only once.
value_to_json_text
Render an engine value as PostgreSQL JSON input text without losing the lexical representation of values already typed as json or jsonb.
value_to_string
value_to_tensor
Coerce a Value into a tensor: an array of homogeneous numeric vectors. Used by TENSOR(N) columns to store chunk embeddings for one row while still indexing each vector element.
value_to_vector
Coerce a Value into a Vec<f32> if it is a homogeneous numeric list (used to read vector literals from ARRAY[...] or $N Vector params).
value_type_name
variadic_argument_value
Return the value expression carried by an explicit VARIADIC marker, including one nested inside a named argument.
vector_value_to_string
PostgreSQL’s legacy int2vector and oidvector text format is a space-separated vector, not the brace-delimited array format used by their array-like runtime carrier.
wrap_variadic_argument
Wrap the last actual argument of an explicit VARIADIC invocation while preserving a named-argument marker at the top level.