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)
Mon, Apr 29, 5:24 PM
Unknown Object (File)
Mon, Apr 29, 1:35 AM
Unknown Object (File)
Sat, Apr 27, 10:55 AM
Unknown Object (File)
Apr 18 2024, 2:08 PM
Unknown Object (File)
Apr 18 2024, 2:08 PM
Unknown Object (File)
Apr 18 2024, 2:08 PM
Unknown Object (File)
Apr 18 2024, 2:08 PM
Unknown Object (File)
Apr 18 2024, 2:07 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
Lint Not Applicable
Unit
Tests Not Applicable

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.