Skip to main content

NAME

Constant NAME 

Source
pub const NAME: NameMarker;
Expand description

Specifies a custom name in the database.

By default a table or view is named after its struct in snake_case, and a column after its field. Use NAME to choose another name.

ยงExamples

// Column `creation_timestamp` instead of `created_at`:
#[column(NAME = "creation_timestamp")]
created_at: DateTime<Utc>,

// Table `user_accounts` instead of `user_account`:
#[PostgresTable(NAME = "user_accounts")]
struct UserAccount { ... }

#[PostgresView(NAME = "active_users")]
struct ActiveUsers { ... }