enova / audit_star Goto Github PK
View Code? Open in Web Editor NEWDatabase change auditing.
License: MIT License
Database change auditing.
License: MIT License
Not sure if this should be the responsibility of audit_star itself or your migration framework, but the audit_all method doesn't have anything to prevent long lock contention resulting from waiting for a lock which lock_timeout
would prevent.
The *snapshot views created by audit_star are not accurate. In order to show a change history accurately, a recursive query is going to be required. Here is an example of what shows instead of what should be shown in the snapshot view.
Given a record with the following 3 changes, the "customer_id" only gets set to a value on the 3rd change
audit=# SELECT foos_audit_id, changed_at, change FROM service_audit_raw.foos_audit WHERE primary_key = '7068' ORDER BY foos_audit_id;
-[ RECORD 1 ]----------+----------------------------------------------------------------------
foos_audit_id | 2176
changed_at | 2016-08-14 00:21:13.740758
change |
-[ RECORD 2 ]----------+----------------------------------------------------------------------
foos_audit_id | 2177
changed_at | 2016-08-14 00:21:13.740758
change | {"pending": "f", "updated_at": "2016-08-14 00:21:13.807175"}
-[ RECORD 3 ]----------+----------------------------------------------------------------------
foos_audit_id | 2178
changed_at | 2016-08-14 00:21:13.740758
change | {"customer_id": "3215620", "updated_at": "2016-08-14 00:21:13.830382"}
However, here is what the snapshot view actually shows:
audit=# SELECT foos_audit_id, customer_id FROM service_audit.foos_audit_snapshot WHERE primary_key = '7068' ORDER BY foos_audit_id;
-[ RECORD 1 ]----------+--------
foos_audit_id | 2176
customer_id | 3215620
-[ RECORD 2 ]----------+--------
foos_audit_id | 2177
customer_id | 3215620
-[ RECORD 3 ]----------+--------
foos_audit_id | 2178
customer_id | 3215620
It should show NULL for customer_id until the very last record.
We expected that the list of excluded_schemas
would be based on direct match, but we were surprised when we configured to exclude one schema which is the prefix of another, and both schemas were excluded!
We found this: https://github.com/enova/audit_star/blob/master/audit/audit.go#L276-L284
This should either be based on a direct match, or the docs should be updated to clearly reflect this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.