Skip to main content

EngineHook

Trait EngineHook 

Source
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§

Source

fn nextval(&self, name: &str) -> Result<i64, String>

Source

fn currval(&self, name: &str) -> Result<i64, String>

Source

fn setval(&self, name: &str, value: i64) -> Result<i64, String>

Provided Methods§

Source

fn call_scalar_function( &self, _name: &str, _args: &[Value], ) -> Option<Result<Value>>

Source

fn has_scalar_functions(&self) -> bool

Source

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.

Source

fn current_schemas( &self, _include_implicit: bool, ) -> Result<Option<Vec<String>>, String>

Resolve the existing schemas visible to the logical session.

Source

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.

Source

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.

Source

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.

Source

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".

Implementors§