pub struct Entity;Available on crate feature
rbac only.Expand description
Generated by sea-orm-macros
Trait Implementationsยง
impl Copy for Entity
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.
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
Sourceยง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.Sourceยง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.Sourceยง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.Sourceยง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>.Sourceยงfn find_by_id<T>(values: T) -> Select<Self>
fn find_by_id<T>(values: T) -> Select<Self>
Find a model by primary key Read more
Sourceยงfn primary_key_identity() -> Identity
fn primary_key_identity() -> Identity
Get primary key as Identity
Sourceยง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
Sourceยง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
Sourceยง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
Sourceยงfn update_many() -> UpdateMany<Self>
fn update_many() -> UpdateMany<Self>
Update many models in database Read more
Sourceยง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
Sourceยงfn delete_many() -> DeleteMany<Self>
fn delete_many() -> DeleteMany<Self>
Delete many models from database Read more
Sourceยงfn delete_by_id<T>(values: T) -> ValidatedDeleteOne<Self>
fn delete_by_id<T>(values: T) -> ValidatedDeleteOne<Self>
Delete a model based on primary key Read more
Sourceยงimpl Iden for Entity
impl Iden for Entity
Sourceยงimpl IdenStatic for Entity
impl IdenStatic 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ยง
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<E> EntityOrSelect<E> for Ewhere
E: EntityTrait,
impl<E> EntityOrSelect<E> for Ewhere
E: EntityTrait,
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> IntoColumnRef for T
impl<T> IntoColumnRef for T
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 moreSourceยงimpl<T> IntoIdentity for Twhere
T: IdenStatic,
impl<T> IntoIdentity for Twhere
T: IdenStatic,
Sourceยงfn into_identity(self) -> Identity
fn into_identity(self) -> Identity
Build the
Identity.