Skip to main content

Column

Enum Column 

Source
pub enum Column {
    Id,
    UserId,
    Action,
    EntityType,
    EntityId,
    EntityName,
    Details,
    IpAddress,
    UserAgent,
    CreatedAt,
}
Expand description

Generated by sea-orm-macros

Variants§

§

Id

Generated by sea-orm-macros

§

UserId

Generated by sea-orm-macros

§

Action

Generated by sea-orm-macros

§

EntityType

Generated by sea-orm-macros

§

EntityId

Generated by sea-orm-macros

§

EntityName

Generated by sea-orm-macros

§

Details

Generated by sea-orm-macros

§

IpAddress

Generated by sea-orm-macros

§

UserAgent

Generated by sea-orm-macros

§

CreatedAt

Generated by sea-orm-macros

Trait Implementations§

Source§

impl Clone for Column

Source§

fn clone(&self) -> Column

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ColumnTrait for Column

Source§

type EntityName = Entity

The entity this column belongs to.
Source§

fn def(&self) -> ColumnDef

SQL type and constraints attached to this column.
Source§

fn enum_type_name(&self) -> Option<&'static str>

If the column maps to a database ENUM, the enum’s type name. Returns None for non-enum columns.
Source§

fn select_as(&self, expr: Expr) -> SimpleExpr

Apply the standard SELECT-side cast for this column. By default, enum columns are cast to text; non-enum columns are returned as-is.
Source§

fn save_as(&self, val: Expr) -> SimpleExpr

Apply the standard write-side cast: convert text into the database’s enum type for enum columns, return as-is otherwise.
Source§

fn json_key(&self) -> &'static str

JSON key used for this column when (de)serializing the model.
§

fn entity_name(&self) -> DynIden

Table iden of the entity this column belongs to.
§

fn as_column_ref(&self) -> (DynIden, DynIden)

Fully-qualified (table, column) reference, used when building expressions that need to disambiguate columns across joined tables.
§

fn eq<V>(&self, v: V) -> Expr
where V: Into<Value>,

Perform equality against a Value. None will be converted to IS NULL. Read more
§

fn ne<V>(&self, v: V) -> Expr
where V: Into<Value>,

Perform inequality against a Value. None will be converted to IS NOT NULL. Read more
§

fn gt<V>(&self, v: V) -> Expr
where V: Into<Value>,

§

fn gte<V>(&self, v: V) -> Expr
where V: Into<Value>,

§

fn lt<V>(&self, v: V) -> Expr
where V: Into<Value>,

§

fn lte<V>(&self, v: V) -> Expr
where V: Into<Value>,

§

fn between<V>(&self, a: V, b: V) -> Expr
where V: Into<Value>,

§

fn not_between<V>(&self, a: V, b: V) -> Expr
where V: Into<Value>,

§

fn like<T>(&self, s: T) -> Expr
where T: IntoLikeExpr,

§

fn not_like<T>(&self, s: T) -> Expr
where T: IntoLikeExpr,

§

fn ilike<T>(&self, s: T) -> Expr
where T: IntoLikeExpr,

Postgres Only. Read more
§

fn not_ilike<T>(&self, s: T) -> Expr
where T: IntoLikeExpr,

Postgres Only. Read more
§

fn starts_with<T>(&self, s: T) -> Expr
where T: Into<String>,

This is a simplified shorthand for a more general like method. Use like if you need something more complex, like specifying an escape character. Read more
§

fn ends_with<T>(&self, s: T) -> Expr
where T: Into<String>,

This is a simplified shorthand for a more general like method. Use like if you need something more complex, like specifying an escape character. Read more
§

fn contains<T>(&self, s: T) -> Expr
where T: Into<String>,

This is a simplified shorthand for a more general like method. Use like if you need something more complex, like specifying an escape character. Read more
§

fn max(&self) -> Expr

See also SeaQuery’s method with same name.
§

fn min(&self) -> Expr

See also SeaQuery’s method with same name.
§

fn sum(&self) -> Expr

See also SeaQuery’s method with same name.
§

fn avg(&self) -> Expr

See also SeaQuery’s method with same name.
§

fn count(&self) -> Expr

See also SeaQuery’s method with same name.
§

fn is_null(&self) -> Expr

See also SeaQuery’s method with same name.
§

fn is_not_null(&self) -> Expr

See also SeaQuery’s method with same name.
§

fn if_null<V>(&self, v: V) -> Expr
where V: Into<Value>,

Provide fallback value if the column is null (null coalescing)
§

fn is_in<V, I>(&self, v: I) -> Expr
where V: Into<Value>, I: IntoIterator<Item = V>,

§

fn is_not_in<V, I>(&self, v: I) -> Expr
where V: Into<Value>, I: IntoIterator<Item = V>,

§

fn eq_any<V, I>(&self, v: I) -> Expr
where V: Into<Value> + NotU8, I: IntoIterator<Item = V>,

Postgres only. Read more
§

fn ne_all<V, I>(&self, v: I) -> Expr
where V: Into<Value> + NotU8, I: IntoIterator<Item = V>,

Postgres only. Opposite of eq_any (equivalent to is_not_in). Read more
§

fn in_subquery(&self, s: SelectStatement) -> Expr

§

fn not_in_subquery(&self, s: SelectStatement) -> Expr

§

fn array_contains<V, I>(&self, v: I) -> Expr
where V: Into<Value> + ValueType + NotU8, I: IntoIterator<Item = V>,

Array operator. Postgres only.
§

fn array_contained<V, I>(&self, v: I) -> Expr
where V: Into<Value> + ValueType + NotU8, I: IntoIterator<Item = V>,

Array operator. Postgres only.
§

fn array_overlap<V, I>(&self, v: I) -> Expr
where V: Into<Value> + ValueType + NotU8, I: IntoIterator<Item = V>,

Array operator. Postgres only.
§

fn into_expr(self) -> Expr

Wrap the column in a plain [Expr], suitable for use anywhere a sea_query expression is expected.
§

fn into_returning_expr(self, db_backend: DatabaseBackend) -> Expr

Wrap the column as the expression used inside a RETURNING clause for the given backend.
§

fn select_enum_as(&self, expr: Expr) -> Expr

Cast an enum column to text; no-op for non-enum columns.
§

fn save_enum_as(&self, val: Expr) -> Expr

Cast a value into the column’s enum type; no-op for non-enum columns.
Source§

impl Debug for Column

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromStr for Column

Source§

type Err = ColumnFromStrErr

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Iden for Column

Source§

fn quoted(&self) -> Cow<'static, str>

Return the to-be sanitized version of the identifier. Read more
Source§

fn unquoted(&self) -> &str

Write a raw identifier string without quotes. Read more
§

fn to_string(&self) -> String

A shortcut for writing an [unquoted][Iden::unquoted] identifier into a String. Read more
Source§

impl IdenStatic for Column

Source§

fn as_str(&self) -> &'static str

The static SQL identifier this value represents.
Source§

impl IntoEnumIterator for Column

Source§

impl Copy for Column

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<C> ColumnAsExpr for C
where C: ColumnTrait,

§

fn into_column_as_expr(self) -> Expr

Build the [SimpleExpr], casting ActiveEnum columns to text; otherwise identical to [IntoSimpleExpr::into_simple_expr].
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<I> IdenList for I
where I: IntoIden,

§

type IntoIter = Once<DynIden>

§

fn into_iter(self) -> <I as IdenList>::IntoIter

§

impl<E, C> IdentityOf<E> for C
where E: EntityTrait<Column = C>, C: ColumnTrait,

§

fn identity_of(self) -> Identity

Build the [Identity].
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoColumnRef for T
where T: Into<ColumnRef>,

§

fn into_column_ref(self) -> ColumnRef

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> IntoIden for T
where T: Into<DynIden>,

§

fn into_iden(self) -> DynIden

§

impl<T> IntoIdentity for T
where T: IdenStatic,

§

fn into_identity(self) -> Identity

Build the [Identity].
§

impl<T> IntoIndexColumn for T
where T: Into<IndexColumn>,

§

fn into_index_column(self) -> IndexColumn

§

impl<C> IntoSimpleExpr for C
where C: ColumnTrait,

§

fn into_simple_expr(self) -> Expr

Build the [SimpleExpr].
§

impl<T> IntoTableRef for T
where T: Into<TableRef>,

§

fn into_table_ref(self) -> TableRef

§

impl<T> IntoTypeRef for T
where T: Into<TypeRef>,

§

fn into_type_ref(self) -> TypeRef

§

impl<T> MaybeQualifiedOnce for T
where T: IntoIden,

§

fn into_2_parts(self) -> (Option<DynIden>, DynIden)

Represent a maybe-qualified name as a (foo?, bar) tuple.
§

impl<T> MaybeQualifiedTwice for T
where T: MaybeQualifiedOnce,

§

fn into_3_parts(self) -> (Option<(Option<DynIden>, DynIden)>, DynIden)

Represent a maybe-qualified name as a (foo?, bar?, baz) tuple. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more