Page MenuHomePhabricator

[native] overload `SQLiteQueryExecutor` constructor
ClosedPublic

Authored by kamil on Jul 19 2023, 5:36 AM.
Tags
None
Referenced Files
F2157634: D8551.id29114.diff
Mon, Jul 1, 2:12 AM
F2157633: D8551.id28824.diff
Mon, Jul 1, 2:12 AM
F2157632: D8551.id28825.diff
Mon, Jul 1, 2:12 AM
F2157577: D8551.diff
Mon, Jul 1, 2:08 AM
F2155220: D8551.id.diff
Sun, Jun 30, 8:49 PM
Unknown Object (File)
Sat, Jun 29, 6:29 AM
Unknown Object (File)
Wed, Jun 26, 8:28 PM
Unknown Object (File)
Tue, Jun 25, 2:49 PM
Subscribers

Details

Summary

On web, we will need to pass database path (path to virtual file in memory) from JS, and the best way will be to achieve this via constructor.

Depends on D8550

Test Plan

N/A

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.Jul 19 2023, 9:00 AM
michal added inline comments.
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
942–945 ↗(On Diff #28825)

Not really sure what the best practices for this are in c++, but can we do sth like call the arg-less constructor, from another constructor instead of calling migrate?

This revision is now accepted and ready to land.Jul 20 2023, 7:53 AM
native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
942–945 ↗(On Diff #28825)

I think we can do sth like:

SQLiteQueryExecutor::SQLiteQueryExecutor() 
  : SQLiteQueryExecutor(*default path*) {}

SQLiteQueryExecutor::SQLiteQueryExecutor(std::string sqliteFilePath) {
  SQLiteQueryExecutor::sqliteFilePath = sqliteFilePath;
  SQLiteQueryExecutor::migrate();
}

but we do not have a default path and this is less readable