Make DbKey required to construct SqliteConnectionSafe.
This commit is contained in:
parent
2008290425
commit
f073c790c5
@ -188,7 +188,7 @@ class SqliteKeyValueAsyncBench final : public td::Benchmark {
|
||||
td::string sql_db_name = "testdb.sqlite";
|
||||
td::SqliteDb::destroy(sql_db_name).ignore();
|
||||
|
||||
sql_connection_ = std::make_shared<td::SqliteConnectionSafe>(sql_db_name);
|
||||
sql_connection_ = std::make_shared<td::SqliteConnectionSafe>(sql_db_name, td::DbKey::empty());
|
||||
auto &db = sql_connection_->get();
|
||||
TRY_STATUS(init_db(db));
|
||||
|
||||
|
@ -94,7 +94,7 @@ class MessagesDbBench final : public Benchmark {
|
||||
auto guard = scheduler_->get_main_guard();
|
||||
|
||||
string sql_db_name = "testdb.sqlite";
|
||||
sql_connection_ = std::make_shared<SqliteConnectionSafe>(sql_db_name);
|
||||
sql_connection_ = std::make_shared<SqliteConnectionSafe>(sql_db_name, DbKey::empty());
|
||||
auto &db = sql_connection_->get();
|
||||
TRY_STATUS(init_db(db));
|
||||
|
||||
|
@ -19,7 +19,7 @@ namespace td {
|
||||
class SqliteConnectionSafe {
|
||||
public:
|
||||
SqliteConnectionSafe() = default;
|
||||
explicit SqliteConnectionSafe(string path, DbKey key = DbKey::empty(), optional<int32> cipher_version = {});
|
||||
SqliteConnectionSafe(string path, DbKey key, optional<int32> cipher_version = {});
|
||||
|
||||
SqliteDb &get();
|
||||
void set(SqliteDb &&db);
|
||||
|
@ -305,7 +305,7 @@ class SqliteKV {
|
||||
return 0;
|
||||
}
|
||||
Status init(string name) {
|
||||
auto sql_connection = std::make_shared<SqliteConnectionSafe>(name);
|
||||
auto sql_connection = std::make_shared<SqliteConnectionSafe>(name, DbKey::empty());
|
||||
kv_ = std::make_shared<SqliteKeyValueSafe>("kv", sql_connection);
|
||||
return Status::OK();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user