Page MenuHomePhabricator

[native] overload `SQLiteQueryExecutor` constructor
ClosedPublic

Authored by kamil on Jul 19 2023, 5:36 AM.
Tags
None
Referenced Files
F3387253: D8551.id29114.diff
Fri, Nov 29, 8:27 AM
Unknown Object (File)
Mon, Nov 25, 8:43 PM
Unknown Object (File)
Mon, Nov 25, 6:29 PM
Unknown Object (File)
Sat, Nov 23, 2:33 PM
Unknown Object (File)
Tue, Nov 12, 12:15 PM
Unknown Object (File)
Oct 26 2024, 1:59 AM
Unknown Object (File)
Oct 15 2024, 6:40 PM
Unknown Object (File)
Oct 14 2024, 12:07 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