pub struct RewriteAssignment {
pub pointer: String,
pub column: String,
pub ir: IrExpr,
pub sql: String,
pub reads_a_multi_link: bool,
}Expand description
Compile a schema Trigger’s handler PyQL statement for DDL emission —
same shape as compile_fn_body, but instead of fn_params this binds
__new__/__old__ as the inserted/updated/deleted row (see
Compiler::special_anchors’s own doc comment), gated by on_mask
(Pylon’s On bitmask: 1=Insert, 2=Update, 4=Delete): __old__ is bound whenever
on_mask does not include Insert (so Update-only, Delete-only, and
Update+Delete all get it — but never a mask that includes Insert, even
combined with Update, since a shared trigger function has no old row on
the Insert branch of that combination); __new__ is bound whenever
on_mask does not include Delete, by the mirror-image argument. A
mask combining Insert and Delete (with no Update) legally binds
neither. Referencing an anchor that isn’t bound is a compile error, not
a runtime NULL.
One compiled rewrite: the column it writes and the value it writes there.
Fields§
§pointer: String§column: String§ir: IrExpr§sql: String§reads_a_multi_link: boolTrue when the expression reads one of the owner’s multi-links. Those
rows live in a junction table the statement writes after the row
itself, so a BEFORE trigger reading one sums an empty set — see
export::rewrite_trigger_infos.
Auto Trait Implementations§
impl Freeze for RewriteAssignment
impl RefUnwindSafe for RewriteAssignment
impl Send for RewriteAssignment
impl Sync for RewriteAssignment
impl Unpin for RewriteAssignment
impl UnsafeUnpin for RewriteAssignment
impl UnwindSafe for RewriteAssignment
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.