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)
Sun, Dec 15, 10:27 PM
Unknown Object (File)
Sun, Dec 15, 7:33 PM
Unknown Object (File)
Sun, Dec 15, 7:33 PM
Unknown Object (File)
Sun, Dec 15, 7:33 PM
Unknown Object (File)
Sun, Dec 8, 8:43 PM
Unknown Object (File)
Nov 18 2024, 7:11 AM
Unknown Object (File)
Nov 14 2024, 9:29 AM
Unknown Object (File)
Nov 14 2024, 9:12 AM

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.