Skip to main content

read_only_txn

Function read_only_txn 

Source
fn read_only_txn(set_clause: &str, body: &str) -> String
Expand description

Wraps body in a BEGIN READ ONLY; <set_clause>; <body>; COMMIT; frame so set_clause is scoped to this read and does not leak into the session.

NOTE: the newline before ; COMMIT; stops a trailing -- comment in body from swallowing the COMMIT.