pub struct ColumnAttributes {
    pub primary_key: bool,
    pub default: bool,
    pub many_to_one_key: Option<Path>,
    pub many_to_many_table: Option<Path>,
    pub one_to_many_foreign_key: Option<Path>,
    pub column: Option<LitStr>,
}
Expand description

Available attributes on a column (struct field)

Fields§

§primary_key: bool§default: bool§many_to_one_key: Option<Path>

Example: pub struct User { pub org_id: i32, #[ormlite(many_to_one_key = org_id)] pub organization: Join, }

§many_to_many_table: Option<Path>

Example: pub struct User { pub org_id: i32, #[ormlite(many_to_many_table_name = join_user_role)] pub roles: Join<Vec>, }

§one_to_many_foreign_key: Option<Path>

Example: pub struct User { pub id: i32, #[ormlite(one_to_many_foreign_key = Post::author_id)] pub posts: Join<Vec>, }

pub struct Post { pub id: i32, pub author_id: i32, }

§column: Option<LitStr>

The name of the column in the database. Defaults to the field name.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.