gda-score / code

Tools for generating General Data Anonymity Scores (www.gda-score.org)
MIT License
7 stars 1 forks source link

refactor generateDbSqlForTable #24

Closed yoid2000 closed 5 years ago

yoid2000 commented 5 years ago

I don't think that generateDbSqlForTable belongs in the gdaUtility class. It is more of a general purpose tool that should be called as a stand-alone tool. (It would never be called as part of measuring utility.)

Could you pull it out and make it a separate tool, and place it at code/common. Obviously, it should have no dependencies on gdaUtility, just gdaScore...

Also there are some parameters in your config file that are not needed. For instance anonXXX (anything starting with anon), criteria, probably uid, maybe others. Please clean this up so that only what is needed is in there.

srnb commented 5 years ago

The parameters(criteria, databsource(both),tableName) are necessary to create gdaAttack object and used for querying. Let me know where the changes should be incorporated. Should it be at the standalone tool or at the `gdaAttack.

yoid2000 commented 5 years ago

Ok, good point gdaAttack, but even so you can just add dummy values in your software rather than expect them in the config file. Do that for now. I'll consider changing gdaAttack to not require those things, but you don't need to touch it.

srnb commented 5 years ago

Can add dummy values in the code for all fields except the anonDb as it the value should match with the myDatabases.json file and also the values should be correct. Because _dbWorker method tries to establish a connection. What workaround I can think of would be replicate rawDb credentials twice and refer it with some name in both .json file and in the code?. or it is better to keep it in inputparameter.json file?

yoid2000 commented 5 years ago

Good point. I would recommend that you have just rawDb in the json, and as you say just replicate that value as anonDb in the code...