Skip to main content

schema_refusal

Function schema_refusal 

Source
pub fn schema_refusal(
    flags: FunctionFlags,
    site: CallSite,
    trusted_schema: bool,
) -> Option<&'static str>
Expand description

Returns why a schema may not call this function, or nothing when it may.

One rule, read by two layers (task-1972). Registry::authorize_function wraps the answer in a DbError for an application that asks the registry directly, and the binder wraps it in a ParseError for the statement it is compiling. Writing the rule twice is how the two would eventually disagree, and the half nobody exercised would be the permissive one.

The rule reads the same way SQLite’s does: a direct-only function is never callable from a schema; anything else is callable from a schema only when the connection trusts the schema or the function is innocuous.

@param flags - what the function promises about itself @param site - where the call was written @param trusted_schema - whether the connection trusts the schema it read