GithubHelp home page GithubHelp logo

dan-da / cdc_audit Goto Github PK

View Code? Open in Web Editor NEW
23.0 11.0 22.0 51 KB

change data capture via audit tables and triggers for mysql.

License: GNU General Public License v2.0

PHP 100.00%
cdc change-data-capture audit-tables mysql commandline triggers data-warehouse

cdc_audit's People

Contributors

dan-da avatar stuart897 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cdc_audit's Issues

General error creating mysql trigger

I'm having an issue with the FOR EACH ROW BEGIN loop wrapping the insert statement. If I remove the BEGIN and END, creating the trigger works just fine.

Using mysql 5.5.

``
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3

``

Working example,

DELIMITER @@ CREATE TRIGGERrate_types_after_insertAFTER INSERT ONrate_typesFOR EACH ROW insert intorate_types_audit (id, type, audit_event, audit_timestamp) values(NEW.id, NEW.type, 'insert', CURRENT_TIMESTAMP); @@

Push support?

Hi @dan-da
I've got an update that adds support for a separate audit schema by extending the namespace capabilities. Additionally, the update adds a "snapshot" query to the end of every file generated, this query can be used to take a snapshot of the current state of the source table. This is useful for starting off a new audit table, or catching up a table thats falling out of sync.

It looks like I can't send in my pull request with the current security settings on the repo, if you would like the update please let me know that you've added me.

Thank you so much for putting this together, this tool helped me a lot.

Warning this is my first PHP code, hopefully the update will meet your quality standards, but if not let me know how to improve.

Suggestion / Question :: update / delete before and after

Have you thought about differentiating between the before update and after update column changes? I'm thinking the audit would be more valuable if you knew what the column values were changed from...

Overall though, amazing project! Love the ease of generating audit tables on the fly.

Not working with PHP7

Unfortunately, PHP7 now uses PDO.
Did you update your scripts for that version of PHP ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.