Skip to main content

Crate alibi_entity_codegen

Crate alibi_entity_codegen 

Source
Expand description

Backend-neutral code generation shared by the AuthEntity derives.

The SeaORM and SQLx derives both generate the Auth* entity trait implementations, the secondary-storage snapshot codec and the declared additional-field output here, so the wire-visible accessor behavior of an application model is identical whichever backend persists it.

Structs§

AuthAttributes
Parsed #[auth(...)] container attributes.
EntityField
A model field with its wire name and explicitly renamed physical column.

Enums§

EntityRole
Insert
What a fresh row stores in one declared field.

Functions§

additional_output
Generate fn additional_fields(&self): undeclared fields and nullable username values reach configured output transforms under their wire and physical names.
auth_account_impl
impl AuthAccount: account fields are all core fields.
auth_session_impl
impl AuthSession: absent plugin fields return their defaults.
auth_user_impl
impl AuthUser: absent plugin fields return their defaults.
auth_verification_impl
impl AuthVerification: verification fields are all core fields.
camel_case
The lowerCamelCase wire name of a snake-case Rust field.
generated_id
Generate an application-selected auth identifier, retaining UUID defaults.
has_field
insert_values
The value a fresh row stores in every declared field except id, in declaration order. Each backend binds its own identifier type.
is_auth_timestamp
Auth date fields whose mutations arrive in the core UTC representation.
is_known_field
Whether a field name is a core or plugin field of the role.
is_option
named_fields
The derive input’s named fields.
optional_field
Whether the named field exists with an Option type.
parse_auth_attributes
Parse the role, optional ID factory and secondary-storage configuration. SQLx also permits an explicit table name.
secondary_codec
Generate the secondary-storage snapshot codec over every model field.
update_statements
The apply_update body of the role over update and now: every field present in update is written; absent plugin fields are skipped.
validate_core_fields
Require every core field of the role.

Type Aliases§

SetField
Renders field = value on the active row, where Insert::Value is convertible into the field type with Into. Insert::Default is never passed.