Page MenuHomePhabricator

[SQLite] implement getting `MessageToDevice` items
ClosedPublic

Authored by kamil on Feb 26 2024, 2:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 21, 2:53 PM
Unknown Object (File)
Mon, Oct 21, 1:44 PM
Unknown Object (File)
Tue, Oct 15, 7:19 AM
Unknown Object (File)
Tue, Oct 15, 7:19 AM
Unknown Object (File)
Tue, Oct 15, 7:19 AM
Unknown Object (File)
Sun, Oct 6, 7:36 AM
Unknown Object (File)
Sep 4 2024, 6:06 AM
Unknown Object (File)
Aug 17 2024, 9:36 PM
Subscribers

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Mar 1 2024, 12:24 AM
marcin requested changes to this revision.Mar 1 2024, 2:22 AM
marcin added inline comments.
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
1717–1719 ↗(On Diff #37691)

The convention is not to use sqlite3_stmt directly but to use SQLiteStatementWrapper that automatically handles preparing, finalizing and errors.

1730–1735 ↗(On Diff #37691)

This code doesn't perform necessary error handling for sqlite3_step and sqlite3_finalize but if you use SQLiteStatementWrapper it will do error handling automatically for you.

This revision now requires changes to proceed.Mar 1 2024, 2:22 AM
marcin added inline comments.
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
1721 ↗(On Diff #37786)

Nit: Error message you provide here suggest that SQLite function that failed was sqlite3_finalize which is not necessarily the case. If one of sqlite3_step fails the SQLiteStatementWrapper destructor will throw an error with error message associated with the failed sqlite3_step. In other words the destructor of SQLiteStatementWrapper throws error with message built from the error code of the first function that failed. That said we should aim for something more general like: "Failed to get all messages to device".

This revision is now accepted and ready to land.Mar 5 2024, 1:27 AM
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
1721 ↗(On Diff #37786)

make sense, thanks for suggestion