pub struct RawSql {
pub postgres: String,
pub mysql: String,
pub sqlite: String,
}Expand description
Raw SQL that may have backend-specific variants
Fields§
§postgres: String§mysql: String§sqlite: StringImplementations§
Source§impl RawSql
impl RawSql
Sourcepub fn per_backend(postgres: String, mysql: String, sqlite: String) -> Self
pub fn per_backend(postgres: String, mysql: String, sqlite: String) -> Self
Create a RawSql with different SQL for each backend
Sourcepub fn postgres_only(sql: String) -> Self
pub fn postgres_only(sql: String) -> Self
Create a RawSql carrying PostgreSQL-only SQL; MySQL and SQLite
get no output.
Replaces the repeated 3-line construction
RawSql::per_backend(pg, String::new(), String::new()) so the
PG-only intent is visible at the call site (and the two
zero-capacity String::new() allocations are written once, in
this constructor).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RawSql
impl RefUnwindSafe for RawSql
impl Send for RawSql
impl Sync for RawSql
impl Unpin for RawSql
impl UnsafeUnpin for RawSql
impl UnwindSafe for RawSql
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> 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> 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