pub enum SQLiteInsertValue<'a, V, T>where
V: SQLParam,{
Omit,
Null,
Value(ValueWrapper<'a, V, T>),
}Available on crate feature
sqlite only.Expand description
Represents a value for INSERT operations that can be omitted, null, or a SQL expression
Variants§
Omit
Omit this column from the INSERT (use database default)
Null
Explicitly insert NULL
Value(ValueWrapper<'a, V, T>)
Insert a SQL expression (value, placeholder, etc.)
Implementations§
Source§impl<'a, T> SQLiteInsertValue<'a, SQLiteValue<'a>, T>
impl<'a, T> SQLiteInsertValue<'a, SQLiteValue<'a>, T>
Sourcepub fn into_owned(self) -> SQLiteInsertValue<'static, SQLiteValue<'static>, T>
pub fn into_owned(self) -> SQLiteInsertValue<'static, SQLiteValue<'static>, T>
Converts this InsertValue to an owned version with ’static lifetime.
The whole SQL fragment is kept: placeholders stay unbound and
expressions such as json(?) keep their shape, with every bound value
detached from its borrow.
Trait Implementations§
Source§impl<'a, V, T> Clone for SQLiteInsertValue<'a, V, T>
impl<'a, V, T> Clone for SQLiteInsertValue<'a, V, T>
Source§fn clone(&self) -> SQLiteInsertValue<'a, V, T>
fn clone(&self) -> SQLiteInsertValue<'a, V, T>
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<'a, V, T> Debug for SQLiteInsertValue<'a, V, T>
impl<'a, V, T> Debug for SQLiteInsertValue<'a, V, T>
Source§impl<'a, V, T> Default for SQLiteInsertValue<'a, V, T>where
V: SQLParam,
impl<'a, V, T> Default for SQLiteInsertValue<'a, V, T>where
V: SQLParam,
Source§fn default() -> SQLiteInsertValue<'a, V, T>
fn default() -> SQLiteInsertValue<'a, V, T>
Returns the “default value” for a type. Read more
Source§impl<'a, T> From<Placeholder> for SQLiteInsertValue<'a, SQLiteValue<'a>, T>
impl<'a, T> From<Placeholder> for SQLiteInsertValue<'a, SQLiteValue<'a>, T>
Source§fn from(placeholder: Placeholder) -> SQLiteInsertValue<'a, SQLiteValue<'a>, T>
fn from(placeholder: Placeholder) -> SQLiteInsertValue<'a, SQLiteValue<'a>, T>
Converts to this type from the input type.
Source§impl<'a, T, U> From<T> for SQLiteInsertValue<'a, SQLiteValue<'a>, U>
Converts a setter argument to the column’s type, then to a bound value.
impl<'a, T, U> From<T> for SQLiteInsertValue<'a, SQLiteValue<'a>, U>
Converts a setter argument to the column’s type, then to a bound value.
§Panics
Panics when the argument does not fit the column type (an integer out of range, a JSON payload that fails to serialize), rather than storing NULL in its place.
Source§fn from(value: T) -> SQLiteInsertValue<'a, SQLiteValue<'a>, U>
fn from(value: T) -> SQLiteInsertValue<'a, SQLiteValue<'a>, U>
Converts to this type from the input type.
Source§impl<'a, M, N, T> From<TypedPlaceholder<M, N>> for SQLiteInsertValue<'a, SQLiteValue<'a>, T>where
M: DataType,
N: Nullability,
impl<'a, M, N, T> From<TypedPlaceholder<M, N>> for SQLiteInsertValue<'a, SQLiteValue<'a>, T>where
M: DataType,
N: Nullability,
Source§fn from(
typed: TypedPlaceholder<M, N>,
) -> SQLiteInsertValue<'a, SQLiteValue<'a>, T>
fn from( typed: TypedPlaceholder<M, N>, ) -> SQLiteInsertValue<'a, SQLiteValue<'a>, T>
Converts to this type from the input type.
Source§impl<'a, const N: usize> From<[u8; N]> for SQLiteInsertValue<'a, SQLiteValue<'a>, Vec<u8>>
impl<'a, const N: usize> From<[u8; N]> for SQLiteInsertValue<'a, SQLiteValue<'a>, Vec<u8>>
Source§fn from(value: [u8; N]) -> SQLiteInsertValue<'a, SQLiteValue<'a>, Vec<u8>>
fn from(value: [u8; N]) -> SQLiteInsertValue<'a, SQLiteValue<'a>, Vec<u8>>
Converts to this type from the input type.
impl<V, T> JsonColumnOperand for SQLiteInsertValue<'_, V, T>where
V: SQLParam,
Source§impl<'a, T> JsonColumnValue<T> for SQLiteInsertValue<'a, SQLiteValue<'a>, T>where
T: Serialize,
impl<'a, T> JsonColumnValue<T> for SQLiteInsertValue<'a, SQLiteValue<'a>, T>where
T: Serialize,
Source§fn from_json(value: Json<T>) -> SQLiteInsertValue<'a, SQLiteValue<'a>, T>
fn from_json(value: Json<T>) -> SQLiteInsertValue<'a, SQLiteValue<'a>, T>
Converts
value into the SQL value of a JSON column. Read moreAuto Trait Implementations§
impl<'a, V, T> Freeze for SQLiteInsertValue<'a, V, T>where
ValueWrapper<'a, V, T>: Freeze,
impl<'a, V, T> RefUnwindSafe for SQLiteInsertValue<'a, V, T>where
ValueWrapper<'a, V, T>: RefUnwindSafe,
impl<'a, V, T> Send for SQLiteInsertValue<'a, V, T>where
ValueWrapper<'a, V, T>: Send,
impl<'a, V, T> Sync for SQLiteInsertValue<'a, V, T>where
ValueWrapper<'a, V, T>: Sync,
impl<'a, V, T> Unpin for SQLiteInsertValue<'a, V, T>where
ValueWrapper<'a, V, T>: Unpin,
impl<'a, V, T> UnsafeUnpin for SQLiteInsertValue<'a, V, T>where
ValueWrapper<'a, V, T>: UnsafeUnpin,
impl<'a, V, T> UnwindSafe for SQLiteInsertValue<'a, V, T>where
ValueWrapper<'a, V, T>: 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestCreates a shared type from an unshared type.
Source§impl<V, Out> JsonColumnArg<Out, Operand> for Vwhere
V: JsonColumnOperand + Into<Out>,
impl<V, Out> JsonColumnArg<Out, Operand> for Vwhere
V: JsonColumnOperand + Into<Out>,
Source§fn into_json_column(self) -> Out
fn into_json_column(self) -> Out
Converts this argument into the model field value.
Source§impl<T, Out> JsonColumnArg<Out, Payload> for Twhere
Out: JsonColumnValue<T>,
impl<T, Out> JsonColumnArg<Out, Payload> for Twhere
Out: JsonColumnValue<T>,
Source§fn into_json_column(self) -> Out
fn into_json_column(self) -> Out
Converts this argument into the model field value.