export-db/pop-db: extend functionality to return more data, allow import of any table in database#534
Merged
mergify[bot] merged 2 commits intoflux-framework:masterfrom Feb 13, 2026
Conversation
14c8cbd to
b80bcbf
Compare
b80bcbf to
01b7c81
Compare
9d8fa64 to
0065312
Compare
0065312 to
b63bc10
Compare
b63bc10 to
fea4acd
Compare
Problem: The export-db and pop-db commands only handle a couple of columns from just the association_table and bank_table. These commands would be more robust if they included export and import support from all of the tables. Restructure 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. Restructure the populate_db() function to handle populating any of the tables in the flux-accounting DB with a corresponding .csv file. Add an optional argument to the function to allow the user to specify which columns to include from the file when populating the table.
Problem: The sharness tests for the pop-db and export-db commands are out-of-date in a couple of ways: - their filenames are not those of the actual table names in the flux-accounting database - they do not include the column names in the first line of the .csv file - the pop-db command no longer has a "--users" optional argument to specify a file containing data for the association_table Update the tests accordingly to account for the improvements made to the export-db and pop-db commands.
fea4acd to
f571b96
Compare
jameshcorbett
approved these changes
Feb 12, 2026
Member
jameshcorbett
left a comment
There was a problem hiding this comment.
Looks reasonable to me!
Member
Author
|
Thanks @jameshcorbett! Setting MWP here |
Contributor
Merge Queue StatusRule:
This pull request spent 5 seconds in the queue, with no time running CI. Required conditions to merge
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #534 +/- ##
=======================================
Coverage 82.93% 82.93%
=======================================
Files 27 27
Lines 2479 2479
=======================================
Hits 2056 2056
Misses 423 423 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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-dbandpop-dbcommands only handle a couple of columns from just theassociation_tableandbank_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.csvfiles, 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.csvfile. 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:
.csvfiles--banksand--usersoptional arguments