Skip to main content

Module audit_log

Module audit_log 

Source
Expand description

Database-backed audit log table and base store.

Aster products share the same audit log storage shape: an actor id, stable action wire value, target entity metadata, optional detail JSON, request metadata, and creation timestamp. Products still own typed action enums, detail schemas, presentation, retention policy, and authorization. This module keeps the common SeaORM table contract, index builders, and simple write/count/delete helpers in one place.

Structs§

ActiveModel
Generated by sea-orm-macros
AuditLogCreate
Product-neutral request to insert one audit log row.
AuditLogCursorSlice
Result of an audit log cursor query.
AuditLogDbStore
SeaORM-backed audit log store.
AuditLogQuery
Product-neutral cursor query for audit logs sorted by (created_at, id) descending.
ColumnIter
An iterator over the variants of Column
Entity
Generated by sea-orm-macros
Model
SeaORM model for audit_logs with product-neutral string action values.
PrimaryKeyIter
An iterator over the variants of PrimaryKey
RelationIter
An iterator over the variants of Relation

Enums§

Column
Generated by sea-orm-macros
PrimaryKey
Generated by sea-orm-macros
Relation
Audit log relations.

Constants§

AUDIT_LOGS_TABLE
Audit log table name.
AUDIT_LOG_ACTION_COLUMN
Stable action wire value column.
AUDIT_LOG_ACTION_CREATED_ID_INDEX
Index name for action cursor scans.
AUDIT_LOG_ACTION_CREATED_USER_INDEX
Index name for action/time/user activity aggregation.
AUDIT_LOG_ACTION_INDEX
Index name for action filtering.
AUDIT_LOG_CREATED_AT_COLUMN
Row creation timestamp column.
AUDIT_LOG_CREATED_AT_INDEX
Index name for created-at scans.
AUDIT_LOG_CREATED_ID_INDEX
Index name for cursor scans by created-at/id.
AUDIT_LOG_DETAILS_COLUMN
Optional product-owned JSON detail column.
AUDIT_LOG_ENTITY_ID_COLUMN
Optional target entity id column.
AUDIT_LOG_ENTITY_NAME_COLUMN
Optional target entity display name column.
AUDIT_LOG_ENTITY_TYPE_COLUMN
Target entity type column.
AUDIT_LOG_ENTITY_TYPE_CREATED_ID_INDEX
Index name for entity-type cursor scans.
AUDIT_LOG_ID_COLUMN
Stable row id column.
AUDIT_LOG_IP_ADDRESS_COLUMN
Optional client IP column.
AUDIT_LOG_USER_AGENT_COLUMN
Optional user-agent column.
AUDIT_LOG_USER_CREATED_ID_INDEX
Index name for user cursor scans.
AUDIT_LOG_USER_ID_COLUMN
Actor user id column. System events use 0.
AUDIT_LOG_USER_ID_INDEX
Index name for user filtering.

Functions§

count_audit_logs_created_between
Counts audit log rows created in [start, end).
count_audit_logs_created_between_with_actions
Counts audit log rows for any of the supplied action wire values in [start, end).
count_distinct_audit_log_users_created_between_with_actions
Counts distinct positive user ids for any supplied action wire value in [start, end).
create_audit_log_requests
Inserts many validated audit log create requests.
create_audit_log_row
Inserts one audit log row using any SeaORM connection or transaction.
create_audit_log_rows
Inserts many audit log active models.
create_audit_logs_action_created_id_index
Builds the action/created-at/id cursor index.
create_audit_logs_action_created_user_index
Builds the action/created/user activity index.
create_audit_logs_action_index
Builds the action index.
create_audit_logs_base_indexes
Returns the base index builders used by the current shared schema.
create_audit_logs_created_at_index
Builds the created-at index.
create_audit_logs_created_id_index
Builds the created-at/id cursor index.
create_audit_logs_entity_type_created_id_index
Builds the entity-type/created-at/id cursor index.
create_audit_logs_query_indexes
Returns the optional activity/query index builders used by admin views.
create_audit_logs_table
Builds the shared audit_logs table creation statement.
create_audit_logs_user_created_id_index
Builds the user/created-at/id cursor index.
create_audit_logs_user_id_index
Builds the user id index.
delete_audit_logs_before
Deletes audit log rows created before the supplied cutoff.
drop_audit_logs_table
Builds the shared audit_logs table drop statement.
find_audit_logs_with_filters_cursor
Finds audit logs with shared cursor filtering.