pub enum Dialect {
Postgres,
MySql,
Sqlite,
}Expand description
An SQL dialect.
TimescaleDB is PostgreSQL with the extension: its helpers
(time_bucket, first, last) compile on Dialect::Postgres.
Variants§
Implementations§
Source§impl Dialect
impl Dialect
Sourcepub fn supports_returning(self) -> bool
pub fn supports_returning(self) -> bool
Whether INSERT, UPDATE and DELETE can return rows.
Sourcepub fn max_bind_values(self) -> usize
pub fn max_bind_values(self) -> usize
The most values one statement can bind: 65,535 on PostgreSQL and MySQL, 32,766 on SQLite. Multi-row inserts are split to stay under it.
Sourcepub fn quote_identifier(self, name: &str) -> String
pub fn quote_identifier(self, name: &str) -> String
name quoted as an identifier ("deals", `deals`), each part
of a schema-qualified name on its own.
use navree_orm::Dialect;
assert_eq!(Dialect::Postgres.quote_identifier("audit.events"), r#""audit"."events""#);
assert_eq!(Dialect::MySql.quote_identifier("odd`name"), "`odd``name`");Trait Implementations§
impl Copy for Dialect
impl Eq for Dialect
Source§impl From<Backend> for Dialect
The dialect a navree-db backend speaks.
impl From<Backend> for Dialect
The dialect a navree-db backend speaks.
use navree_db::Backend;
use navree_orm::Dialect;
assert_eq!(Dialect::from(Backend::MySql), Dialect::MySql);
assert_eq!(Dialect::Postgres.backend(), Backend::Postgres);impl StructuralPartialEq for Dialect
Auto Trait Implementations§
impl Forget for Dialect
impl Freeze for Dialect
impl Move for Dialect
impl RefUnwindSafe for Dialect
impl Send for Dialect
impl Sync for Dialect
impl Unpin for Dialect
impl UnsafeUnpin for Dialect
impl UnwindSafe for Dialect
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 moreSource§impl<T> ValueFor<Option<T>> for T
impl<T> ValueFor<Option<T>> for T
Source§fn into_value_for(self) -> Option<T>
fn into_value_for(self) -> Option<T>
The value as the column’s type.