Skip to main content

main_query

Function main_query 

Source
pub fn main_query(
    action_plan: &ActionPlan,
    config: &AppConfig,
    dialect: &dyn SqlDialect,
    method: &str,
    path: &str,
    role: Option<&str>,
    headers_json: Option<&str>,
    cookies_json: Option<&str>,
    claims_json: Option<&str>,
) -> MainQuery
Expand description

Build all queries for an API request.

Routes the ActionPlan to the appropriate statement builder and assembles the full query bundle including session variables and pre-request calls.

§Behaviour

  • ActionPlan::Db(DbCrud { .. }) routes to main_read, main_write, or main_call depending on the CrudPlan variant
  • ActionPlan::Db(MayUseDb(InspectPlan)) generates a schema inspection query (not yet implemented — placeholder for future phases)
  • ActionPlan::NoDb(InfoPlan) generates no SQL (handled at the HTTP layer)

§Returns

A MainQuery with the session setup, pre-request, and main query SQL.