Add support for dumping to SQLite #42
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey @dreadl0ck,
I've known and been watching this project for a while now, and recently got more interested in it again while working on a little side project. In it, I have the need to combine the data from a few different audit record types. After first hacking something together operating on several files at once, I figured it could be useful to view and/or combine the data using SQL for further analysis instead. It also seemed useful for others, so I started working on an SQLite integration for the
dumpcommand.The PR currently only adds support for the
Connectiontype, as I first wanted to gauge whether or not this would be something you'd be willing to merge. I decided to put it in its own package, to not clutter the existingio.Dumpfunction with the SQLite format. It usesmodernc.org/sqlite, so no CGo is required for SQLite support.Personally, I think the approach in this PR is more convenient than first dumping multiple audit record type files to CSV, and then importing into SQLite, as the data type information doesn't get lost, but it does require adding/maintaining additional helper functions for each (supported) audit record type. If the current approach isn't satisfactory, I could look into creating some utility command to dump multiple audit record files to CSV and then 1) import them into a database, or 2) write the raw SQL to files.
Thank you for working on Netcap! 😄