pub struct PlPgSqlBlock {
pub declarations: Vec<PlPgSqlDeclare>,
pub statements: Vec<PlPgSqlStmt>,
pub exception_handlers: Vec<ExceptionHandler>,
}Expand description
v7.12.4 — PL/pgSQL BEGIN ... END; block. v7.12.6 widens
from assignment + return to a real-PL/pgSQL surface:
DECLARE-block local variables, IF/ELSIF/ELSE/END IF
control flow, RAISE diagnostics, and embedded SQL
statements that execute through the regular engine path.
The remaining v7.12.x carve-out is loops (LOOP/WHILE/FOR),
which mailrs’s trigger doesn’t need but other PG customers
may; deferred to a future minor release.
Fields§
§declarations: Vec<PlPgSqlDeclare>v7.12.6 — DECLARE var TYPE [:= init_expr]; declarations
preceding BEGIN. Empty when the body opens directly with
BEGIN. Declarations execute in order; each may reference
earlier-declared locals in its init expression.
statements: Vec<PlPgSqlStmt>§exception_handlers: Vec<ExceptionHandler>v7.37.20 (20.10) — `EXCEPTION WHEN
` handlers appended to the block. Empty when no
EXCEPTION clause is present. When a body statement raises
(via RAISE EXCEPTION, ASSERT falsy, or a runtime error),
handlers are tried in order; the first matching condition
runs its body and the block terminates cleanly. `OTHERS`
matches any exception. Unhandled exceptions propagate.
Trait Implementations§
Source§impl Clone for PlPgSqlBlock
impl Clone for PlPgSqlBlock
Source§fn clone(&self) -> PlPgSqlBlock
fn clone(&self) -> PlPgSqlBlock
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PlPgSqlBlock
impl Debug for PlPgSqlBlock
Source§impl Display for PlPgSqlBlock
impl Display for PlPgSqlBlock
Source§impl PartialEq for PlPgSqlBlock
impl PartialEq for PlPgSqlBlock
impl StructuralPartialEq for PlPgSqlBlock
Auto Trait Implementations§
impl Freeze for PlPgSqlBlock
impl RefUnwindSafe for PlPgSqlBlock
impl Send for PlPgSqlBlock
impl Sync for PlPgSqlBlock
impl Unpin for PlPgSqlBlock
impl UnsafeUnpin for PlPgSqlBlock
impl UnwindSafe for PlPgSqlBlock
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