pub struct JoinClause<D: Dialect> { /* private fields */ }Expand description
Accumulator passed to join/left_join/… closures to build ON conditions.
The closure receives an empty JoinClause, chains on/on_val/on_raw
calls, and returns it; the builder stores the collected conditions.
Implementations§
Source§impl<D: Dialect> JoinClause<D>
impl<D: Dialect> JoinClause<D>
Sourcepub fn on(self, col: &str, op: &'static str, col2: &str) -> Self
pub fn on(self, col: &str, op: &'static str, col2: &str) -> Self
lhs op rhs — both sides are columns (each escaped at compile time).
Sourcepub fn on_val(self, col: &str, op: &'static str, val: impl IntoBind) -> Self
pub fn on_val(self, col: &str, op: &'static str, val: impl IntoBind) -> Self
col op ? — col escaped, the value bound as a placeholder.
Sourcepub fn on_raw(self, sql: &str, binds: Vec<Value>) -> Self
pub fn on_raw(self, sql: &str, binds: Vec<Value>) -> Self
Raw ON SQL fragment with its own binds — the verbatim escape hatch.
§Warning: positional placeholder contract
sql is emitted verbatim (it is NOT escaped or renumbered) and
binds are appended to the running bind list in order. For
Postgres, the caller MUST write $N numbers matching the actual
bind position — that is, number of binds already accumulated + 1, +2,
… For MySQL/SQLite use ?. No renumbering is performed, so a wrong $N
produces a malformed query.
Trait Implementations§
Auto Trait Implementations§
impl<D> Freeze for JoinClause<D>
impl<D> RefUnwindSafe for JoinClause<D>where
D: RefUnwindSafe,
impl<D> Send for JoinClause<D>
impl<D> Sync for JoinClause<D>
impl<D> Unpin for JoinClause<D>where
D: Unpin,
impl<D> UnsafeUnpin for JoinClause<D>
impl<D> UnwindSafe for JoinClause<D>where
D: UnwindSafe,
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more