1use uqa_core::{ArrayValue, DecimalValue, TemporalValue, Value};
11
12use crate::ast::{BinaryOp, Expr};
13#[cfg(test)]
14use crate::ast::{ColumnType, FunctionBinding, FunctionDispatch};
15use crate::error::{Result, SQLError};
16use crate::params::SQLParam;
17#[cfg(test)]
18use crate::result::ResultRow;
19
20mod array_transform;
21mod encoding;
22mod floating;
23pub(crate) mod integer_input;
24mod json;
25mod json_strip;
26mod random;
27mod range;
28mod regex;
29mod time;
30mod uuid;
31
32pub use array_transform::{
33 argument_positions as array_transform_argument_positions,
34 argument_positions_with_control as array_transform_argument_positions_with_control,
35};
36pub use json::{validate_json_object_key_type, value_to_json_text};
37pub use json_strip::argument_positions as json_strip_nulls_argument_positions;
38pub use range::{
39 multirange_from_ranges, parse_multirange, parse_range, CanonicalMultirange, CanonicalRange,
40};
41use time::{
42 age_between, coerce_temporal, format_pg_number, format_temporal, hex_encode, make_timestamp,
43 parse_timestamp, pg_to_chrono_fmt,
44};
45pub use uuid::parse_uuid_bytes;
46use uuid::{generate_random_uuid, generate_uuid_v7};
47mod binary;
48mod casting;
49mod conversion;
50mod current_time;
51mod scalar_array;
52mod scalar_core;
53mod scalar_dispatch;
54mod scalar_geospatial;
55mod scalar_helpers;
56mod scalar_json;
57mod scalar_math;
58mod scalar_postgres;
59mod scalar_range;
60mod scalar_temporal;
61mod session_settings;
62
63#[cfg(test)]
64use binary::eval_comparison_op;
65pub use binary::{
66 compare_nullable_with_control, compare_typed_values_with_control, compare_with_control,
67 eval_binary_values, eval_binary_values_with_control, eval_binary_values_with_integer_width,
68 eval_binary_values_with_integer_width_with_control, eval_comparison_truth,
69 eval_comparison_truth_with_control, integer_width_for_literal, integer_width_for_type, truthy,
70 type_comparison_can_fail, validate_legacy_vector_comparison, value_comparison_can_fail,
71 values_equal_nullable_with_control, values_equal_with_control, IntegerWidth,
72};
73pub(crate) use binary::{division_by_zero, out_of_range};
74pub use casting::{
75 array_dimensions, cast_value, cast_value_from, cast_value_from_with_control, negate_value,
76 negate_value_with_control, parse_pg_array_literal, parse_pg_array_literal_with_control,
77};
78use conversion::{
79 allocation_error, coerce_i64, float_to_i64_rounded, float_to_i64_trunc, nonnegative_usize,
80 to_decimal, to_i64,
81};
82pub use conversion::{
83 array_value_to_string, value_to_string, value_to_string_with_control, vector_value_to_string,
84};
85pub(crate) use conversion::{tensor_items, vector_element, vector_items};
86pub use conversion::{
87 value_to_tensor, value_to_tensor_with_control, value_to_vector, value_to_vector_with_control,
88};
89pub use current_time::clock_timestamp_micros;
90pub use floating::{
91 eval_float_arithmetic, eval_float_arithmetic_with_control, format_real, FloatWidth,
92};
93#[cfg(test)]
94use scalar_dispatch::eval_scalar_function;
95use scalar_helpers::{point_xy, typeof_value};
96pub use scalar_helpers::{quote_ident, CompiledLikePattern};
97
98mod builtin;
99mod call_arguments;
100mod call_dispatch;
101mod context;
102mod diagnostics;
103mod evaluator;
104
105pub use builtin::{
106 bound_scalar_function_strictness, builtin_scalar_function_strictness,
107 eval_bound_builtin_function_call,
108};
109pub use call_arguments::{
110 call_argument_value, evaluate_call_args, validate_named_argument_order,
111 validate_named_argument_order_with_control, variadic_argument_value, wrap_variadic_argument,
112};
113pub use call_dispatch::{
114 eval_builtin_function_call, eval_function_call, eval_generated_function_call_with_control,
115};
116pub use context::{
117 cast_value_with_type_resolution, cast_value_with_type_resolution_with_control,
118 coercion_type_name, format_regtype_value, format_regtype_value_with_control, EngineHook,
119 EvalContext, RowLookup,
120};
121pub use diagnostics::{unknown_function_error, value_type_name};
122pub use evaluator::eval;
123mod numeric_operator;
124use evaluator::eval_between_with_control;
125pub use numeric_operator::{eval_numeric_operator, eval_numeric_operator_with_control};
126
127#[cfg(test)]
128mod tests;
129
130mod json_carrier;
131pub use json_carrier::{core_value_to_json, value_to_text, value_to_text_with_control};