1 unstable release
0.1.0 | Dec 17, 2020 |
---|
#36 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_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.
Dependencies
~25–35MB
~648K SLoC