Page MenuHomePhabricator

Refactor some SQLiteQueryExecutor code
ClosedPublic

Authored by inka on Oct 7 2022, 7:58 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 29, 12:34 AM
Unknown Object (File)
Mon, Apr 29, 12:34 AM
Unknown Object (File)
Mon, Apr 29, 12:34 AM
Unknown Object (File)
Mon, Apr 29, 12:34 AM
Unknown Object (File)
Mon, Apr 29, 12:34 AM
Unknown Object (File)
Mon, Apr 29, 12:33 AM
Unknown Object (File)
Mon, Apr 29, 12:06 AM
Unknown Object (File)
Mar 28 2024, 9:43 AM

Details

Summary

Refactor code handling Metadata table to avoid repeating code. Functions used before have been left as wrappers as suggested in comments on ENG-1979.

Test Plan

Running the ios simulator. I feel like, since there is no functional change, and the changes are pretty simple, it should be enough to check if everything compiles, but if I should test
it more thoroughly please let me know.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

inka added a reviewer: ashoat.

Adding Ashoat because the changes are related to our discussion on ENG-1979

inka requested review of this revision.Oct 7 2022, 8:08 AM
ashoat added 1 blocking reviewer(s): marcin.

Looks good to me!! Would be great if @marcin could take a look as well

native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
881 ↗(On Diff #17417)

Nit – I link to keep this-> on these so it's clear the function is on the class, and not just a standalone function

Looks good!
I also favour using this-> when referencing class members.

Add this-> to class member calls

Looks good!
I also favour using this-> when referencing class members.

At some point we agreed to use this -> https://www.notion.so/commapp/C-coding-standards-8c9f22b4b16a41c3a868eb5f537db1de

marcin requested changes to this revision.Oct 10 2022, 3:15 AM
marcin added inline comments.
native/cpp/CommonCpp/DatabaseManagers/DatabaseQueryExecutor.h
63–65 ↗(On Diff #17432)

Those methods should be private

63–65 ↗(On Diff #17432)

They can take their arguments by reference.

native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.h
63–65 ↗(On Diff #17432)

Same.

This revision now requires changes to proceed.Oct 10 2022, 3:15 AM

Make metadata functions private. I'm not really happy with making them private this way, but I was trying to follow the convention set by the migrate function.

marcin added a reviewer: tomek.

Looking at signatures of other methods in DatabaseQueryExecutor I can see that they also do not take their parameters by reference. The reason is probably thread safety so we can ignore my previous comment that suggested passing arguments to setMetadata, getMetadata and clearMetadata by reference.

This revision is now accepted and ready to land.Oct 10 2022, 5:55 AM