pub enum ColumnDefault {
CurrentTimestamp,
Null,
Integer(i64),
Float(f64),
Text(String),
}Expand description
Safe values allowed for a column DEFAULT clause.
Accepting a raw &str would allow DDL injection through the DEFAULT
position. This enum restricts callers to known-safe literals.
Variants§
CurrentTimestamp
CURRENT_TIMESTAMP — standard SQL timestamp literal.
Null
NULL — explicit SQL null default.
Integer(i64)
A non-negative integer literal (e.g. 0, 1).
Float(f64)
A non-negative real literal (e.g. 0.0).
Text(String)
A string literal that will be single-quoted and escaped.
Only printable ASCII excluding ' and \ is accepted.
Implementations§
Trait Implementations§
Source§impl Clone for ColumnDefault
impl Clone for ColumnDefault
Source§fn clone(&self) -> ColumnDefault
fn clone(&self) -> ColumnDefault
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ColumnDefault
impl Debug for ColumnDefault
Source§impl PartialEq for ColumnDefault
impl PartialEq for ColumnDefault
Source§fn eq(&self, other: &ColumnDefault) -> bool
fn eq(&self, other: &ColumnDefault) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ColumnDefault
Auto Trait Implementations§
impl Freeze for ColumnDefault
impl RefUnwindSafe for ColumnDefault
impl Send for ColumnDefault
impl Sync for ColumnDefault
impl Unpin for ColumnDefault
impl UnsafeUnpin for ColumnDefault
impl UnwindSafe for ColumnDefault
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