pub struct MainQuery {
pub tx_vars: Option<SqlBuilder>,
pub pre_req: Option<SqlBuilder>,
pub mutation: Option<SqlBuilder>,
pub main: Option<SqlBuilder>,
}Expand description
A bundle of SQL queries to execute for a single API request.
Created by main_query. The executor runs these queries in order:
tx_vars— sets session variables (search_path, role, request context)pre_req— calls the pre-request function (if configured)main— the actual data query (read / mutate / call)
Each field is Option<SqlBuilder> because not every request needs all three
queries (e.g., info requests have no main query).
Fields§
§tx_vars: Option<SqlBuilder>Session variable setup query (SELECT set_config(…)).
pre_req: Option<SqlBuilder>Pre-request function call (SELECT schema.pre_request()).
mutation: Option<SqlBuilder>Mutation statement (INSERT/UPDATE/DELETE with RETURNING).
Only set for backends that don’t support DML in CTEs (e.g. SQLite).
When set, main contains only the aggregation SELECT over a temp table
populated by this mutation.
main: Option<SqlBuilder>Main data query (CTE-wrapped SELECT / INSERT / UPDATE / DELETE / CALL).
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MainQuery
impl RefUnwindSafe for MainQuery
impl Send for MainQuery
impl Sync for MainQuery
impl Unpin for MainQuery
impl UnsafeUnpin for MainQuery
impl UnwindSafe for MainQuery
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more