mirror of
https://gitee.com/openharmony/distributeddatamgr_relational_store
synced 2024-11-23 07:00:41 +00:00
fix backup
Signed-off-by: Anvette <anwentao@huawei.com>
This commit is contained in:
parent
386669232e
commit
a57b4a9075
@ -966,7 +966,11 @@ napi_value RdbStoreProxy::Backup(napi_env env, napi_callback_info info)
|
||||
auto exec = [context]() -> int {
|
||||
CHECK_RETURN_ERR(context->rdbStore != nullptr);
|
||||
auto rdbStore = std::move(context->rdbStore);
|
||||
return rdbStore->Backup(context->tableName, context->newKey);
|
||||
auto res = rdbStore->Backup(context->tableName, context->newKey);
|
||||
if (res == E_DB_NOT_EXIST) {
|
||||
return E_OK;
|
||||
}
|
||||
return res;
|
||||
};
|
||||
auto output = [context](napi_env env, napi_value &result) {
|
||||
napi_status status = napi_get_undefined(env, &result);
|
||||
|
@ -2236,6 +2236,7 @@ std::pair<int32_t, std::shared_ptr<Connection>> RdbStoreImpl::CreateWritableConn
|
||||
{
|
||||
auto config = config_;
|
||||
config.SetHaMode(HAMode::SINGLE);
|
||||
config.SetCreateNecessary(false);
|
||||
auto [result, conn] = Connection::Create(config, true);
|
||||
if (result != E_OK || conn == nullptr) {
|
||||
LOG_ERROR("create connection failed, err:%{public}d", result);
|
||||
|
Loading…
Reference in New Issue
Block a user