pub enum SQLiteInsertValue<'a, V: SQLParam, T> {
Omit,
Null,
Value(ValueWrapper<'a, V, T>),
}Expand description
One field of a generated insert model: left out, NULL, or a value.
You rarely build this directly. The with_* setters and new on a
generated InsertX model convert their arguments into it.
Variants§
Omit
Leave the column out of the INSERT so the database default applies.
Null
Insert NULL.
Value(ValueWrapper<'a, V, T>)
Insert a bound value, placeholder or SQL expression.
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 field to a 'static form that owns its data.
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: SQLParam, T> Default for SQLiteInsertValue<'a, V, T>
impl<'a, V: SQLParam, T> Default for SQLiteInsertValue<'a, V, T>
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) -> Self
fn from(placeholder: Placeholder) -> Self
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.