Page MenuHomePhabricator

[native] overload `SQLiteQueryExecutor` constructor
ClosedPublic

Authored by kamil on Jul 19 2023, 5:36 AM.
Tags
None
Referenced Files
F2176258: D8551.diff
Wed, Jul 3, 3:41 AM
Unknown Object (File)
Mon, Jul 1, 2:12 AM
Unknown Object (File)
Mon, Jul 1, 2:12 AM
Unknown Object (File)
Mon, Jul 1, 2:12 AM
Unknown Object (File)
Mon, Jul 1, 2:08 AM
Unknown Object (File)
Sun, Jun 30, 8:49 PM
Unknown Object (File)
Sat, Jun 29, 6:29 AM
Unknown Object (File)
Wed, Jun 26, 8:28 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
Branch
wasm-publish
Lint
No Lint Coverage
Unit
No Test Coverage

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