pub struct Script {
pub statements: Vec<(Node, String)>,
/* private fields */
}Expand description
The statements of the body of a function in SQL that Body::Statements runs, which fmgr_sql analyzes and runs one after the other, as prepare_next_query and init_execution_state do. A statement can see the changes of the statements before it.
Fields§
§statements: Vec<(Node, String)>Each statement, with its text.
Implementations§
Source§impl Script
impl Script
Sourcepub fn read_only(&self) -> bool
pub fn read_only(&self) -> bool
True for a function that is not volatile, which can run only statements that do not write, as readonly_func of SQLFunctionHashEntry is.
Sourcepub fn planned(&self, i: usize) -> bool
pub fn planned(&self, i: usize) -> bool
True when the statement i has a plan. The other statements run as utility statements.
Sourcepub fn analyze(
&self,
env: &dyn Env,
inputs: &[u32],
i: usize,
) -> Result<Option<Query>>
pub fn analyze( &self, env: &dyn Env, inputs: &[u32], i: usize, ) -> Result<Option<Query>>
prepare_next_query: the query of the statement i for a call with arguments of the types inputs. The last statement gives the result of the function, as check_sql_fn_retval checks it. None for a statement with no plan.
§Errors
The errors of the analysis of the statement, and 42P13 for a last statement that does not give the result of the function.