Page MenuHomePhabricator

Implement methods in SQLiteQueryExecutor and DatabaseQueryExecutor to store and retrieve current_user_id from SQLite
ClosedPublic

Authored by marcin on Aug 10 2022, 5:43 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 9, 3:37 PM
Unknown Object (File)
Sat, Nov 9, 7:40 AM
Unknown Object (File)
Fri, Nov 8, 1:10 PM
Unknown Object (File)
Fri, Oct 25, 7:19 PM
Unknown Object (File)
Oct 10 2024, 3:17 PM
Unknown Object (File)
Oct 10 2024, 3:17 PM
Unknown Object (File)
Oct 10 2024, 3:17 PM
Unknown Object (File)
Oct 10 2024, 3:17 PM

Details

Summary

This differential defines in DatabaseQueryExecutor abstract class and implements in SQLiteQueryExecutor methods that insert and retrieve id of currently logged user in metadata table in SQLite. The method to retrieve user id will return empty string if there is no such row in metadata table.

Test Plan

Place those functions somewhere in AppDelegate, and place breakpoints where they are called. Build the app with database encryption disabled. Launch the app in the debugger, look at the SQLite database (accessible from terminal if using iOS simulator) before setCurrentUserID is called and afterwards. Ensure metadata table changes.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Add diff link to commit description

native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
784–787 ↗(On Diff #15506)

Is this really what clang-format wants? Is clang-format actually running here?

This revision is now accepted and ready to land.Aug 11 2022, 5:50 AM
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
784–787 ↗(On Diff #15506)

I always run yarn clang-format-all before updating/submitting a diff. This file (SQliteQueryExecutor.cpp) is returned by get_clang_paths_cli.js script which means it is not possible for this diff to pass phabricator CI if it was not formatted by clang.