NAME

Constant NAME 

Source
pub const NAME: NameMarker;
Expand description

Specifies a custom name in the database.

By default, table, view, and column names are automatically converted to snake_case from the Rust struct/field name. Use NAME to override this behavior.

§Column Example

// Field `createdAt` becomes `created_at` by default
created_at: DateTime<Utc>,

// Override with custom name:
#[column(NAME = "creation_timestamp")]
created_at: DateTime<Utc>,

§Table Example

// Struct `UserAccount` becomes table `user_account` by default
struct UserAccount { ... }

// Override with custom name:
#[PostgresTable(NAME = "user_accounts")]
struct UserAccount { ... }

§View Example

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