Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export-db/pop-db: extend functionality to return more data, allow import of any table in database #534

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cmoussa1
Copy link
Member

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.


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 the populate_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:

  • updated the filenames to match the table names in the flux-accounting DB
  • include the column names in the first line of the .csv files
  • drop the use of the --banks and --users optional arguments

@cmoussa1 cmoussa1 added improvement Upgrades to an already existing feature low priority items that can be worked on at a later date labels Nov 12, 2024
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.
@cmoussa1 cmoussa1 force-pushed the restructure.db-info branch from 14c8cbd to b80bcbf Compare December 30, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Upgrades to an already existing feature low priority items that can be worked on at a later date
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant