Page MenuHomePhabricator

[native] overload `SQLiteQueryExecutor` constructor
ClosedPublic

Authored by kamil on Jul 19 2023, 5:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 26, 1:59 AM
Unknown Object (File)
Tue, Oct 15, 6:40 PM
Unknown Object (File)
Mon, Oct 14, 12:07 PM
Unknown Object (File)
Mon, Oct 14, 12:07 PM
Unknown Object (File)
Mon, Oct 14, 12:07 PM
Unknown Object (File)
Mon, Oct 14, 12:07 PM
Unknown Object (File)
Mon, Oct 14, 12:06 PM
Unknown Object (File)
Sep 28 2024, 7:05 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