pub struct Entity;Expand description
Generated by sea-orm-macros
Trait Implementations§
Source§impl EntityName for Entity
impl EntityName for Entity
Source§fn schema_name(&self) -> Option<&str>
fn schema_name(&self) -> Option<&str>
Schema name this table lives in (PostgreSQL / SQL Server). Returns
None when the table lives in the connection’s default schema.Source§fn table_name(&self) -> &'static str
fn table_name(&self) -> &'static str
SQL name of the table.
§fn table_ref(&self) -> TableRef
fn table_ref(&self) -> TableRef
[
TableRef] for this entity, qualified with schema_name
if one is set.Source§impl EntityTrait for Entity
impl EntityTrait for Entity
type Model = Model
type ModelEx = Model
type ActiveModel = ActiveModel
Source§type ActiveModelEx = ActiveModel
type ActiveModelEx = ActiveModel
The “extended” ActiveModel produced by
#[derive(DeriveActiveModelEx)]
(or by #[sea_orm::model] in the 2.0 dense format) — same as
ActiveModel, but with extra fields for HasOne / HasMany
relations so the entire object graph can be saved in one call. Read moretype Column = Column
type PrimaryKey = PrimaryKey
type Relation = Relation
§fn belongs_to<R>(related: R) -> RelationBuilder<Self, R>where
R: EntityTrait,
fn belongs_to<R>(related: R) -> RelationBuilder<Self, R>where
R: EntityTrait,
Start building a
belongs_to relation: this table holds the foreign
key pointing at related. Call .from(...).to(...) on the returned
builder to specify the column mapping.§fn has_one<R>(_: R) -> RelationBuilder<Self, R>where
R: EntityTrait + Related<Self>,
fn has_one<R>(_: R) -> RelationBuilder<Self, R>where
R: EntityTrait + Related<Self>,
Start building a
has_one relation: R holds a foreign key pointing
back at this entity. Requires R: Related<Self> so the column
mapping can be inferred from the reverse belongs_to.§fn has_many<R>(_: R) -> RelationBuilder<Self, R>where
R: EntityTrait + Related<Self>,
fn has_many<R>(_: R) -> RelationBuilder<Self, R>where
R: EntityTrait + Related<Self>,
Start building a
has_many relation: R holds a foreign key
pointing back at this entity. Requires R: Related<Self> so the
column mapping can be inferred from the reverse belongs_to.§fn has_many_via<R, T>(_: R, rel: T) -> RelationBuilder<Self, R>where
R: EntityTrait,
T: RelationTrait,
fn has_many_via<R, T>(_: R, rel: T) -> RelationBuilder<Self, R>where
R: EntityTrait,
T: RelationTrait,
Like
has_many, but takes an explicit reverse
[RelationTrait] instead of relying on Related<Self> — useful when
the related entity does not (or cannot) implement Related<Self>.§fn find_by_id<T>(values: T) -> Select<Self>where
T: Into<<Self::PrimaryKey as PrimaryKeyTrait>::ValueType>,
fn find_by_id<T>(values: T) -> Select<Self>where
T: Into<<Self::PrimaryKey as PrimaryKeyTrait>::ValueType>,
Find a model by primary key Read more
§fn primary_key_identity() -> Identity
fn primary_key_identity() -> Identity
Get primary key as Identity
§fn insert<A>(model: A) -> Insert<A>where
A: ActiveModelTrait<Entity = Self>,
fn insert<A>(model: A) -> Insert<A>where
A: ActiveModelTrait<Entity = Self>,
Insert a model into database Read more
§fn insert_many<A, I>(models: I) -> InsertMany<A>where
A: ActiveModelTrait<Entity = Self>,
I: IntoIterator<Item = A>,
fn insert_many<A, I>(models: I) -> InsertMany<A>where
A: ActiveModelTrait<Entity = Self>,
I: IntoIterator<Item = A>,
Insert many models into database Read more
§fn update<A>(model: A) -> UpdateOne<A>where
A: ActiveModelTrait<Entity = Self>,
fn update<A>(model: A) -> UpdateOne<A>where
A: ActiveModelTrait<Entity = Self>,
Update a model in database Read more
§fn update_many() -> UpdateMany<Self>
fn update_many() -> UpdateMany<Self>
Update many models in database Read more
§fn delete<A>(model: A) -> DeleteOne<Self>where
A: ActiveModelTrait<Entity = Self>,
fn delete<A>(model: A) -> DeleteOne<Self>where
A: ActiveModelTrait<Entity = Self>,
Delete a model from database Read more
§fn delete_many() -> DeleteMany<Self>
fn delete_many() -> DeleteMany<Self>
Delete many models from database Read more
§fn delete_by_id<T>(values: T) -> ValidatedDeleteOne<Self>where
T: Into<<Self::PrimaryKey as PrimaryKeyTrait>::ValueType>,
fn delete_by_id<T>(values: T) -> ValidatedDeleteOne<Self>where
T: Into<<Self::PrimaryKey as PrimaryKeyTrait>::ValueType>,
Delete a model based on primary key Read more
Source§impl Iden for Entity
impl Iden for Entity
impl Copy for Entity
Auto Trait Implementations§
impl Freeze for Entity
impl RefUnwindSafe for Entity
impl Send for Entity
impl Sync for Entity
impl Unpin for Entity
impl UnsafeUnpin for Entity
impl UnwindSafe for Entity
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<E> EntityOrSelect<E> for Ewhere
E: EntityTrait,
impl<E> EntityOrSelect<E> for Ewhere
E: EntityTrait,
§impl<I> IdenList for Iwhere
I: IntoIden,
impl<I> IdenList for Iwhere
I: IntoIden,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoColumnRef for Twhere
T: Into<ColumnRef>,
impl<T> IntoColumnRef for Twhere
T: Into<ColumnRef>,
fn into_column_ref(self) -> ColumnRef
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§impl<T> IntoIdentity for Twhere
T: IdenStatic,
impl<T> IntoIdentity for Twhere
T: IdenStatic,
§fn into_identity(self) -> Identity
fn into_identity(self) -> Identity
Build the [
Identity].§impl<T> IntoIndexColumn for Twhere
T: Into<IndexColumn>,
impl<T> IntoIndexColumn for Twhere
T: Into<IndexColumn>,
fn into_index_column(self) -> IndexColumn
§impl<T> IntoTableRef for Twhere
T: Into<TableRef>,
impl<T> IntoTableRef for Twhere
T: Into<TableRef>,
fn into_table_ref(self) -> TableRef
§impl<T> IntoTypeRef for Twhere
T: Into<TypeRef>,
impl<T> IntoTypeRef for Twhere
T: Into<TypeRef>,
fn into_type_ref(self) -> TypeRef
§impl<T> MaybeQualifiedOnce for Twhere
T: IntoIden,
impl<T> MaybeQualifiedOnce for Twhere
T: IntoIden,
§fn into_2_parts(self) -> (Option<DynIden>, DynIden)
fn into_2_parts(self) -> (Option<DynIden>, DynIden)
Represent a maybe-qualified name as a
(foo?, bar) tuple.§impl<T> MaybeQualifiedTwice for Twhere
T: MaybeQualifiedOnce,
impl<T> MaybeQualifiedTwice for Twhere
T: MaybeQualifiedOnce,
§fn into_3_parts(self) -> (Option<(Option<DynIden>, DynIden)>, DynIden)
fn into_3_parts(self) -> (Option<(Option<DynIden>, DynIden)>, DynIden)
Represent a maybe-qualified name as a
(foo?, bar?, baz) tuple. Read more