Skip to main content

EntityName

Trait EntityName 

Source
pub trait EntityName: IdenStatic + Default {
    // Required method
    fn table_name(&self) -> &'static str;

    // Provided methods
    fn schema_name(&self) -> Option<&str> { ... }
    fn comment(&self) -> Option<&str> { ... }
    fn table_ref(&self) -> TableRef { ... }
}
Expand description

Names the SQL table backing an Entity, plus the optional schema and comment metadata.

One of the building blocks of EntityTrait; usually generated via #[derive(DeriveEntity)] or #[derive(DeriveEntityModel)].

Required Methods§

Source

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

SQL name of the table.

Provided Methods§

Source

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 comment(&self) -> Option<&str>

SQL comment to attach to the table when it is created.

Source

fn table_ref(&self) -> TableRef

TableRef for this entity, qualified with schema_name if one is set.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl EntityName for sea_orm::rbac::entity::permission::Entity

Available on crate feature rbac only.
Source§

impl EntityName for sea_orm::rbac::entity::resource::Entity

Available on crate feature rbac only.
Source§

impl EntityName for sea_orm::rbac::entity::role::Entity

Available on crate feature rbac only.
Source§

impl EntityName for sea_orm::rbac::entity::role_hierarchy::Entity

Available on crate feature rbac only.
Source§

impl EntityName for sea_orm::rbac::entity::role_permission::Entity

Available on crate feature rbac only.
Source§

impl EntityName for sea_orm::rbac::entity::user_override::Entity

Available on crate feature rbac only.
Source§

impl EntityName for sea_orm::rbac::entity::user_role::Entity

Available on crate feature rbac only.