In the future there will be a need to update database version in different places, that being said extracting logic to separate function.
Additionally, added error handling which will detect if SQL was executed without failure.
Details
Details
- Check if logged database version is propper (could be compared with user_version visible after connecting to the database).
- Check if the version is set correctly after migrations (to test eg. logout user, after this version should be set to the highest currently possible).
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp | ||
---|---|---|
575 ↗ | (On Diff #17606) | Is it OK to ignore failure to set database version? This function returns false if SQL query fails but its return value is not checked against. I am not saying we need to check for every SQL query failure. I just want to be sure that this is conscious decision to ignore it here. |
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp | ||
---|---|---|
575 ↗ | (On Diff #17606) |
It's not but this diff only extracts logic to function (and adds checks for errors) for now, and keeps the previous behavior - where code ignore errors. Handling these errors would be introduced in another diff - it's not part of this stack, we need a proper architecture for handling this, I am currently implementing this (tasks). |