Skip to content

Commit

Permalink
docs: Improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonAM committed May 27, 2022
1 parent 859b42a commit b425cc9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
# pgtrail
Auditing system for PostgreSQL

# Description

It creates new schema `pgtrail` which contains required functions and default audit storage table.
You can use function `pgtrail.enable_audit('public.table_name')` for starting auditing changes of a table.
This function will add a trigger to your table, which will be call on inserts, updates or deletes and will log
all the information to default storage table `pgtrail.audit_changes`.

You can see an example, by going to `examples/` and running `./run_example_docker.sh`. Example creates a table `employees`
and fills it with some test data, after which applies some changes so audit is generated. The script will build docker container
for the example, start it in detached mode and then would put you into `psql` tools where you can tinker with the database.
For example, you can run `SELECT * FROM pgtrail.audit_changes;` to see all existing change. Alternatively you can use
your favourite database management tool to connect to the container on standard port 5432.

# Roadmap
- Tests
- Benchmarks
- Implement functions to get state of a record at given time (by applying changes)
- Implement automatic creation of storage table if it doesn't exist yet
- Partitioning
- Explore option for removing requirement of object_id to be uuid
- Make it an extension (?)
- Explore option for json metadata passing through transaction level 'current_setting("metadata)', fx for tracing id

0 comments on commit b425cc9

Please sign in to comment.