[−][src]Crate sql_audit
The companion library to sql-audit-cli
, though you can just use this instead if you'd like to
generate audit programmatically.
Limitations
- Currently this lib only knows how to use
sqlx
, so you must use it too.
Tour
generate_audit
is the programmatic equivalent of runningsql-audit-cli
.query_audit
lets you query the audit table... currently only supports querying all records for a table.set_local_app_user
sets the value to fill intoapp_user
in the audit table for the duration of the current transaction.set_local_request_id
sets the value to fill intorequest_id
in the audit table for the duration of the current transaction.
Structs
AuditRecord | A structure representing a single row of the |
Constants
APP_USER_SETTING | A constant for the setting used to record |
REQUEST_ID_SETTING | A constant for the setting used to record |
Functions
generate_audit | Generate the audit infrastructure for the database that the passed |
query_audit | Get all the audit records for a specific table. |
set_local_app_user | Set a value to be recorded in the |
set_local_request_id | Set a value to be recorded in the |