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

[WIP] export-db: allow formatting customization of association_table and bank_table #529

Closed

Conversation

cmoussa1
Copy link
Member

@cmoussa1 cmoussa1 commented Nov 7, 2024

Problem

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 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.

Refactor the export_db_info() function to allow customization of which
fields to extract from both association_table and bank_table through
optional arguments. Dynamically build each SQLite query using these
custom fields and include which columns are being used in the header of
the .csv files.
Problem: Now that export-db can format custom output and includes a
header, the pop-db command should expect a header when populating the
DB with user and bank information.

Add skips of the both the banks .csv files and users .csv files when
reading from them.
Problem: The tests for the pop-db and export-db commands are outdated
with the improvements made to export_db_info() - namely, the inclusion
of headers in the .csv file & the customization of output.

Adjust the tests in t1009-pop-db.t and t1016-export-db.t to account for
the changes made to export_db_info().
@cmoussa1 cmoussa1 added improvement Upgrades to an already existing feature low priority items that can be worked on at a later date labels Nov 7, 2024
@cmoussa1 cmoussa1 changed the title Improve.export.and.pop.db export-db: allow formatting customization of association_table and bank_table Nov 8, 2024
@cmoussa1 cmoussa1 changed the title export-db: allow formatting customization of association_table and bank_table [WIP] export-db: allow formatting customization of association_table and bank_table Nov 8, 2024
@cmoussa1 cmoussa1 closed this Nov 12, 2024
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