pub struct IrSelect {
pub rows: Vec<IrRowSource>,
pub filter: Option<IrExpr>,
pub order_by: Vec<IrSort>,
pub offset: Option<IrExpr>,
pub limit: Option<IrExpr>,
pub distinct: bool,
pub dml_source: Option<Box<IrStmt>>,
pub polymorphic: bool,
pub poly_implementors: Vec<IrPolyImplementor>,
pub poly_columns: Vec<String>,
pub lock: Option<IrLockClause>,
}Fields§
§rows: Vec<IrRowSource>What each output row comes from. Almost always exactly one Bound
(a schema object) — more than one entry, or a Free entry, only
happens for a literal set/union (select {1,2,3}).
filter: Option<IrExpr>Only ever Some when rows is a single Bound — a free select can
never have a FILTER (enforced at compile time).
order_by: Vec<IrSort>§offset: Option<IrExpr>§limit: Option<IrExpr>§distinct: bool§dml_source: Option<Box<IrStmt>>When this SELECT wraps a DML statement (SELECT (INSERT …) { … }),
the inner DML is stored here and emitted as a CTE.
None for plain SELECT Type { … } and for any free select.
Only ever Some when rows is a single Bound.
polymorphic: boolTrue when this SELECT targets an interface type.
The SQL emitter builds a UNION ALL inline instead of hitting the view.
Only meaningful when rows is a single Bound.
poly_implementors: Vec<IrPolyImplementor>Concrete implementors of the interface (populated when polymorphic = true).
poly_columns: Vec<String>Interface column names used in the UNION ALL branches (e.g. ["id", "email"]).
lock: Option<IrLockClause>Trailing FOR UPDATE/FOR SHARE/… row-locking clause. Validated
at compile time (Compiler::compile_select) to only ever be Some
on a single schema-bound, non-polymorphic, non-DML-wrapped,
non-DISTINCT row source — the same shape Postgres itself requires
output rows to map 1:1 to physical table rows for locking to make
sense.
Implementations§
Source§impl IrSelect
impl IrSelect
Sourcepub fn schema_bound(
source: IrSource,
shape: Vec<IrShapePointer>,
filter: Option<IrExpr>,
) -> Self
pub fn schema_bound( source: IrSource, shape: Vec<IrShapePointer>, filter: Option<IrExpr>, ) -> Self
The overwhelming-majority shape: one schema-bound row, no DML, no polymorphism — what most correlated-subquery/EXISTS builders want.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IrSelect
impl RefUnwindSafe for IrSelect
impl Send for IrSelect
impl Sync for IrSelect
impl Unpin for IrSelect
impl UnsafeUnpin for IrSelect
impl UnwindSafe for IrSelect
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.