Skip to main content

SqlxModel

Trait SqlxModel 

Source
pub trait SqlxModel:
    SqlxRow
    + Clone
    + Send
    + Sync
    + 'static {
    const TABLE: &'static str;
    const COLUMNS: &'static [ColumnDef];
    const COLUMN_NAMES: &'static [&'static str];
    const PRIMARY_KEY: &'static str;
    const FIELD_COLUMNS: &'static [(&'static str, &'static str)] = _;
    const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = None;

    // Required methods
    fn into_active(self) -> ActiveRow;
    fn from_active(active: ActiveRow) -> AuthResult<Self>;

    // Provided methods
    fn column_value(column: &str, value: SqlValue) -> SqlValue { ... }
    fn timestamp_value(column: &str, value: DateTime<Utc>) -> SqlValue { ... }
    fn column_kind(column: &str) -> ColumnKind { ... }
}
Expand description

A table-backed SQLx model.

Required Associated Constants§

Source

const TABLE: &'static str

Physical table name.

Source

const COLUMNS: &'static [ColumnDef]

Physical columns in model field order.

Source

const COLUMN_NAMES: &'static [&'static str]

The names of COLUMNS, for select and returning lists.

Source

const PRIMARY_KEY: &'static str

Physical primary-key column.

Provided Associated Constants§

Source

const FIELD_COLUMNS: &'static [(&'static str, &'static str)] = _

Rust field names paired with their physical columns.

Source

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = None

Provider verification column whose SQLite storage may retain raw scalars. Other model roles and handwritten models retain their existing projection.

Required Methods§

Source

fn into_active(self) -> ActiveRow

Every column as an unchanged value.

Source

fn from_active(active: ActiveRow) -> AuthResult<Self>

Materialize a model without a database write. Omitted optional fields become None; other omitted fields fail.

§Errors

Returns an error if a required field is omitted or has another type.

Provided Methods§

Source

fn column_value(column: &str, value: SqlValue) -> SqlValue

Apply this physical column’s binding override without changing its Rust String representation. Ordinary TEXT/VARCHAR columns remain unchanged.

Source

fn timestamp_value(column: &str, value: DateTime<Utc>) -> SqlValue

Bind the auth UTC clock using this model column’s timestamp wire type.

Source

fn column_kind(column: &str) -> ColumnKind

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl SqlxModel for alibi_sqlx::store::entities::account::Model

Source§

const TABLE: &'static str = "account"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::api_key::Model

Source§

const TABLE: &'static str = "apikey"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::device_code::Model

Source§

const TABLE: &'static str = "deviceCode"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::invitation::Model

Source§

const TABLE: &'static str = "invitation"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::jwk::Model

Source§

const TABLE: &'static str = "jwks"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::member::Model

Source§

const TABLE: &'static str = "member"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::organization::Model

Source§

const TABLE: &'static str = "organization"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::organization_role::Model

Source§

const TABLE: &'static str = "organizationRole"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::passkey::Model

Source§

const TABLE: &'static str = "passkey"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::session::Model

Source§

const TABLE: &'static str = "session"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::team::Model

Source§

const TABLE: &'static str = "team"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::team_member::Model

Source§

const TABLE: &'static str = "teamMember"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::two_factor::Model

Source§

const TABLE: &'static str = "twoFactor"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::user::Model

Source§

const TABLE: &'static str = "user"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str>

Source§

impl SqlxModel for alibi_sqlx::store::entities::verification::Model

Source§

const TABLE: &'static str = "verification"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::wallet_address::Model

Source§

const TABLE: &'static str = "walletAddress"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::oauth_access_token::Model

Source§

const TABLE: &'static str = "oauthAccessToken"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::oauth_client::Model

Source§

const TABLE: &'static str = "oauthClient"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::oauth_client_assertion::Model

Source§

const TABLE: &'static str = "oauthClientAssertion"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::oauth_client_resource::Model

Source§

const TABLE: &'static str = "oauthClientResource"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::oauth_consent::Model

Source§

const TABLE: &'static str = "oauthConsent"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::oauth_refresh_token::Model

Source§

const TABLE: &'static str = "oauthRefreshToken"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::oauth_resource::Model

Source§

const TABLE: &'static str = "oauthResource"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None

Source§

impl SqlxModel for alibi_sqlx::store::entities::sso_provider::Model

Source§

const TABLE: &'static str = "ssoProvider"

Source§

const COLUMNS: &'static [ColumnDef]

Source§

const COLUMN_NAMES: &'static [&'static str]

Source§

const FIELD_COLUMNS: &'static [(&'static str, &'static str)]

Source§

const PRIMARY_KEY: &'static str = "id"

Source§

const PROVIDER_VERIFICATION_COLUMN: Option<&'static str> = ::std::option::Option::None