pub trait EngineHook {
// Required methods
fn nextval(&self, name: &str) -> Result<i64, String>;
fn currval(&self, name: &str) -> Result<i64, String>;
fn setval(&self, name: &str, value: i64) -> Result<i64, String>;
// Provided methods
fn call_scalar_function(
&self,
_name: &str,
_args: &[Value],
) -> Option<Result<Value>> { ... }
fn has_scalar_functions(&self) -> bool { ... }
fn current_schema(&self) -> Result<Option<String>, String> { ... }
fn current_schemas(
&self,
_include_implicit: bool,
) -> Result<Option<Vec<String>>, String> { ... }
fn random_value(&self) -> Result<Option<f64>, String> { ... }
fn set_random_seed(&self, _seed: f64) -> Result<bool, String> { ... }
fn call_user_function(
&self,
_name: &str,
_args: &[(Option<String>, Value)],
) -> Option<Result<Value>> { ... }
fn call_bound_user_function(
&self,
_binding: &FunctionBinding,
_args: &[(Option<String>, Value)],
) -> Option<Result<Value>> { ... }
}Expand description
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.
Required Methods§
fn nextval(&self, name: &str) -> Result<i64, String>
fn currval(&self, name: &str) -> Result<i64, String>
fn setval(&self, name: &str, value: i64) -> Result<i64, String>
Provided Methods§
fn call_scalar_function( &self, _name: &str, _args: &[Value], ) -> Option<Result<Value>>
fn has_scalar_functions(&self) -> bool
Sourcefn current_schema(&self) -> Result<Option<String>, String>
fn current_schema(&self) -> Result<Option<String>, String>
Resolve the first existing schema on the logical session’s search
path. None lets standalone expression evaluation use its public
compatibility default.
Sourcefn current_schemas(
&self,
_include_implicit: bool,
) -> Result<Option<Vec<String>>, String>
fn current_schemas( &self, _include_implicit: bool, ) -> Result<Option<Vec<String>>, String>
Resolve the existing schemas visible to the logical session.
Sourcefn random_value(&self) -> Result<Option<f64>, String>
fn random_value(&self) -> Result<Option<f64>, String>
Draw from an engine-owned logical-session PRNG. None keeps pure,
engine-free expression evaluation available for library callers.
Sourcefn set_random_seed(&self, _seed: f64) -> Result<bool, String>
fn set_random_seed(&self, _seed: f64) -> Result<bool, String>
Reseed the logical-session PRNG. false means the hook does not own a
mutable random stream and the caller must report the unsupported call.
Sourcefn call_user_function(
&self,
_name: &str,
_args: &[(Option<String>, Value)],
) -> Option<Result<Value>>
fn call_user_function( &self, _name: &str, _args: &[(Option<String>, Value)], ) -> Option<Result<Value>>
Invoke a user-defined SQL / PL/pgSQL function. Consulted
after built-in dispatch misses (and immediately for calls with
named arguments, which built-ins never accept). None means
no user-defined function with this name exists.
fn call_bound_user_function( &self, _binding: &FunctionBinding, _args: &[(Option<String>, Value)], ) -> Option<Result<Value>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".