Skip to main content

Module routine

Module routine 

Source
Expand description

Calling a stored routine.

§The name is quoted and the values are bound

A routine name is not a value and cannot travel as a bound parameter, so it is pasted into the call. It goes through crate::sql::ident::quote, the one sanctioned way to do that, which refuses a name it cannot quote instead of producing text that would change what the call means. Every argument travels bound, so an argument can never become part of the call.

§Why every result set is kept apart

A routine may answer with several result sets, and folding them into one loses which row came from which. Each set is therefore returned with its own position and its own columns.

On the prepared protocol this server also returns the final values of the routine’s output parameters, and it returns them as a result set of their own after the last one the routine produced. They are labelled as such, so a routine that answers only through its parameters still answers.

Structs§

Call
Which routine is being called, and with what.
Parameter
One declared parameter, with where it sits and which way it carries.
Planned
The call to build once the caller has named some parameters as output.
ResultSet
One result set a routine produced.

Functions§

as_value
The answer a call carries.
build
Builds the call to one routine.
execute
Runs a call and keeps every result set it produced apart from the others.
plan
Places a session variable at each named output and a marker at the rest.
refuse_statement_as_name
Refuses a text asked to be a routine name that is not one.
serve
Calls one routine, through the guards a call has to pass.
signature
Reads the parameters a routine declares.