[WIP] export-db
: allow formatting customization of association_table
and bank_table
#529
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.
Problem
The
export_db_info()
function statically defines the columns extracted from both thebank_table
and theassociation_table
, but there could definitely be a case where the user extracting DB information wants to customize the format of the data they are retrieving.This PR refactors the
export_db_info()
function to allow customization of which fields to extract from bothassociation_table
andbank_table
through optional arguments. It dynamically builds each SQLite query using thesecustom fields and includes which columns are being used in the header of the
.csv
files.I've adjusted the
populate_db()
function as well as the tests for both thepop-db
andexport-db
commands to account for the adjustments toexport_db_info()
- namely, skipping the headers of the.csv
files and including custom formatting in theexport-db
calls.