The export_db_info() function statically defines the columns extracted from both the bank_table and the association_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 both association_table and bank_table through optional arguments. It dynamically builds each SQLite query using these
custom 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 the pop-db and export-db commands to account for the adjustments to export_db_info() - namely, skipping the headers of the .csv files and including custom formatting in the export-db calls.
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 these custom 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.