1 unstable release
| 0.1.0 | Dec 17, 2020 |
|---|
#31 in #audit
Used in sql-audit-cli
12KB
170 lines
A companion library to sql-audit-cli implementing all of the same
functionality, plus useful runtime operations like:
- Set current
app_user - Set current
request_id - Query audit database
lib.rs:
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_auditis the programmatic equivalent of runningsql-audit-cli.query_auditlets you query the audit table... currently only supports querying all records for a table.set_local_app_usersets the value to fill intoapp_userin the audit table for the duration of the current transaction.set_local_request_idsets the value to fill intorequest_idin the audit table for the duration of the current transaction.
Dependencies
~23–33MB
~625K SLoC