pub struct AdminSqlRequest {
pub sql: String,
pub read_only: bool,
pub commit: bool,
pub statement_timeout_ms: u32,
pub max_rows: usize,
pub session_vars: Vec<(String, String)>,
}Expand description
One operator-supplied statement, and every bound the database is asked to enforce on it (#962).
This is the call shape of
DatabaseAdapter::execute_admin_sql,
the only path on which FraiseQL runs SQL it did not generate. Every field is a
containment control, and each is enforced by PostgreSQL rather than by
inspecting the statement text:
read_onlybecomes the transaction’s own mode, so a write is refused with SQLSTATE25006no matter how it is spelled. A parser deciding whether a string “is a SELECT” is a guess about a dialect it does not own; a read-only transaction is not.commitis the only thing that makes any effect outlast the request. The transaction is rolled back otherwise, which is what makes the default a preview.statement_timeout_msisSET LOCAL statement_timeout, so the server cancels the backend.session_varsare the same transaction-local settings the executor applies for a real query, which is what lets an operator preview a row under a tenant’s RLS rather than as the pool’s role.
Not #[non_exhaustive]: it is a trait method’s parameter list, so adding a
field is a breaking change either way, and a struct literal makes an omitted
bound a compile error rather than a default someone did not choose.
Fields§
§sql: StringThe statement to run, verbatim. Never parsed, rewritten or inspected.
read_only: boolStart the transaction READ ONLY.
commit: boolCommit instead of rolling back. false is a preview.
statement_timeout_ms: u32SET LOCAL statement_timeout for the transaction, in milliseconds.
max_rows: usizeStop reading after this many rows and report the result as truncated.
session_vars: Vec<(String, String)>Transaction-local settings applied before the statement, as
set_config(name, value, true) — the RLS-preview identity.
Trait Implementations§
Source§impl Clone for AdminSqlRequest
impl Clone for AdminSqlRequest
Source§fn clone(&self) -> AdminSqlRequest
fn clone(&self) -> AdminSqlRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more