pub struct Select {Show 14 fields
pub table: String,
pub table_alias: Option<String>,
pub columns: Vec<SelectItem>,
pub joins: Vec<Join>,
pub filter: Option<Predicate>,
pub scope: Option<Scope>,
pub group_by: Vec<Expr>,
pub having: Option<Predicate>,
pub distinct: bool,
pub distinct_on: Vec<Expr>,
pub order: Vec<OrderBy>,
pub limit: Option<u32>,
pub offset: Option<u32>,
pub union: Option<Box<Union>>,
}Expand description
A SELECT.
Fields§
§table: String§table_alias: Option<String>§columns: Vec<SelectItem>Empty ⇒ SELECT *.
joins: Vec<Join>§filter: Option<Predicate>§scope: Option<Scope>§group_by: Vec<Expr>§having: Option<Predicate>§distinct: bool§distinct_on: Vec<Expr>DISTINCT ON (<exprs>) — Postgres-only (fails closed elsewhere). Non-empty takes
precedence over distinct; empty ⇒ inactive.
order: Vec<OrderBy>§limit: Option<u32>§offset: Option<u32>§union: Option<Box<Union>>UNION [ALL] <query> — one level (the branch’s own union is not rendered). Each side
carries its own scope/filter, so both stay tenant-isolated.
Implementations§
Source§impl Select
impl Select
Sourcepub fn force_scope(&mut self, scope: &Scope) -> Result<(), OrmError>
pub fn force_scope(&mut self, scope: &Scope) -> Result<(), OrmError>
Force a host-resolved scope onto this SELECT and every nested read node — its
UNION branch — so a tenant scope reaches every row source (a union branch left unscoped
would leak across tenants). Overwrites any pre-existing scope. This is the host’s tenant
injection point for reads; the guest never sets a scope of its own.
Trait Implementations§
impl StructuralPartialEq for Select
Auto Trait Implementations§
impl Freeze for Select
impl RefUnwindSafe for Select
impl Send for Select
impl Sync for Select
impl Unpin for Select
impl UnsafeUnpin for Select
impl UnwindSafe for Select
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