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

Sqlite basic #48

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open

Sqlite basic #48

wants to merge 28 commits into from

Conversation

mfmceneaney
Copy link
Collaborator

Added functionality to create an SQLite database in addition to the JSON database. Also, created groovy scripts to convert back and forth between SQLite and JSON databases.

@c-dilks c-dilks self-requested a review May 24, 2023 21:34
@c-dilks
Copy link
Member

c-dilks commented May 24, 2023

The qaTree.json file produced by qaCut.groovy isn't the last place this file is modified; see flowchart documentation, where the qaTree.json file is subsequently used in various "Manual QA" scripts. If we modify qaCut.groovy, we may want to modify everything downstream too.

Alternatively, we could just use your JSON <=> SQLite converters. Then we could just continue to use the JSON file internally, then when ready to upload the final version to the QADB, convert the JSON file to a SQLite file. When we need to update that SQLite file, bring it back here, convert to JSON, edit, then revert to SQLite. This would be the easier approach for now, and if we end up benefiting significantly from the change to SQLite, we could then consider refactoring everything here to just use SQLite instead of JSON.

@c-dilks
Copy link
Member

c-dilks commented May 25, 2023

We will also have to convert chargeTree.json, but maybe it's time to combine it with qaTree.json (which could be done in qaCut.groovy)

@mfmceneaney
Copy link
Collaborator Author

Sorry I forgot about chargeTree.json. I agree it is probably easiest to first use JSON internally and convert to SQLite for the QADB. If we are going to keep JSON as the internal format though, it might be easier to just keep qaTree.json and chargeTree.json separate for now since that works well already, and then we can combine them into a single SQL database with a converter script after all the manual QA. In the future, if we switch to using SQL internally then we could just combine them into a single database upstream of the manual QA.

@c-dilks
Copy link
Member

c-dilks commented May 25, 2023

Sounds good. So the converter could take both qaTree.json and (optionally) chargeTree.json as input and would output a single DB (and vice versa for the opposite converter). I say optionally because we are now thinking of removing chargeTree.json altogether, but that's a separate discussion; for now let's keep supporting it.

@mfmceneaney mfmceneaney marked this pull request as draft May 25, 2023 17:16
@mfmceneaney mfmceneaney marked this pull request as ready for review May 25, 2023 19:27
@mfmceneaney
Copy link
Collaborator Author

I removed the SQL database creation routine in qaCut.groovy so it should be identical to main now. I also added SQL <-> JSON conversion scripts for chargeTree.json. Converting chargeTree.json to SQL for a dataset will add all that data as a separate table called ${dataset}_chargeTree the entries of which can be cross referenced with the qaTree*.json table ${dataset} via the file and run numbers.

@mfmceneaney mfmceneaney marked this pull request as draft May 26, 2023 18:36
@mfmceneaney mfmceneaney marked this pull request as ready for review May 26, 2023 19:30
@c-dilks
Copy link
Member

c-dilks commented Jul 27, 2023

Holding off on this for now, since ideas for the future of QADB are under discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Use a database file format, instead of json
2 participants