Skip to main content

SqlxAccountModel

Trait SqlxAccountModel 

Source
pub trait SqlxAccountModel: AuthAccount + SqlxModel {
    // Required methods
    fn id_column() -> &'static str;
    fn provider_id_column() -> &'static str;
    fn account_id_column() -> &'static str;
    fn user_id_column() -> &'static str;
    fn created_at_column() -> &'static str;
    fn parse_id(id: &str) -> AuthResult<SqlValue>;
    fn parse_user_id(user_id: &str) -> AuthResult<SqlValue>;
    fn new_active(
        id: Option<SqlValue>,
        create_account: CreateAccount,
        now: DateTime<Utc>,
    ) -> ActiveRow;
    fn apply_update(
        active: &mut ActiveRow,
        update: UpdateAccount,
        now: DateTime<Utc>,
    );

    // Provided methods
    fn additional_field_bindings(
        fields: &FieldValues,
        _backend: Engine,
    ) -> AuthResult<Vec<(&'static str, SqlValue)>> { ... }
    fn set_additional_field(
        _active: &mut ActiveRow,
        _column: &'static str,
        _value: SqlValue,
        _backend: Engine,
    ) -> AuthResult<()> { ... }
    fn oauth_token_columns() -> Option<[&'static str; 3]> { ... }
}

Required Methods§

Source

fn id_column() -> &'static str

Source

fn provider_id_column() -> &'static str

Source

fn account_id_column() -> &'static str

Source

fn user_id_column() -> &'static str

Source

fn created_at_column() -> &'static str

Source

fn parse_id(id: &str) -> AuthResult<SqlValue>

§Errors

Returns an error if the identifier is invalid for this model’s ID type.

Source

fn parse_user_id(user_id: &str) -> AuthResult<SqlValue>

§Errors

Returns an error if the user identifier is invalid for this model’s ID type.

Source

fn new_active( id: Option<SqlValue>, create_account: CreateAccount, now: DateTime<Utc>, ) -> ActiveRow

Source

fn apply_update( active: &mut ActiveRow, update: UpdateAccount, now: DateTime<Utc>, )

Provided Methods§

Source

fn additional_field_bindings( fields: &FieldValues, _backend: Engine, ) -> AuthResult<Vec<(&'static str, SqlValue)>>

Bind configured fields to actual model columns while retaining raw numbers.

§Errors

Returns an error if configured additional fields cannot be bound to model columns.

Source

fn set_additional_field( _active: &mut ActiveRow, _column: &'static str, _value: SqlValue, _backend: Engine, ) -> AuthResult<()>

§Errors

Returns an error if the field value is unsupported by the model column.

Source

fn oauth_token_columns() -> Option<[&'static str; 3]>

Physical access, refresh and ID token columns for operator conversion. Handwritten models opt in explicitly; absence fails closed.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§