export-db/pop-db
: extend functionality to return more data, allow import of any table in database
#534
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
andpop-db
commands only handle a couple of columns from just theassociation_table
andbank_table
. These commands would be more robust if they included export and import support from all of the tables.This PR restructures the
export_db_info()
function to return data from all of the tables in the flux-accounting DB into separate.csv
files, labeled with their table names in the database. It also restructures thepopulate_db()
function to handle populating any of the tables in the flux-accounting DB with a corresponding.csv
file. It adds an optional argument to the command which allows the user to specify which columns to include from the file when populating the table.As a result of the improvements made to both functions, I've also restructured the tests for both of these commands slightly, mostly just:
.csv
files--banks
and--users
optional arguments