Rindle docs and package mapSkip to main content

execute_public_script

Function execute_public_script 

pub fn execute_public_script(
    backend: &mut impl OneShotBackend,
    statements: &[SqlStatementRequest],
    idempotency_key: &str,
    aggregate_result_byte_limit: usize,
    now_ms: i64,
) -> ScriptOutcome
Expand description

Execute one public script (execute-multiple): an ORDERED sequence of autocommit units, each dispatched by statement class into execute_public_batch (reads/writes) or execute_public_ddl (DDL) under a per-index derived idempotency key — sql-script:<key>:<index>. Replay identity across retries depends on that exact format: every completed statement’s outcome is stored under its derived key, so a retry of the whole script replays the durable prefix instead of re-applying it, then resumes at the statement that failed. Transaction-control statements and classes outside the v1 surface are refused without reaching the backend.

The aggregate result cap is shared across the script through a shrinking allowance: each statement’s single-batch limit is the script’s remaining allowance plus the 2 array-delimiter bytes the batch executor charges itself, and each completed result is then charged (separators included) via append_bounded_script_results. Never Err at the top level — failure is data (ScriptOutcome::failure), alongside the completed prefix’s results and the last committed cursor.