mirror of
https://gitee.com/openharmony/distributeddatamgr_relational_store
synced 2024-11-27 09:11:59 +00:00
commit
111edf3ece
@ -74,6 +74,8 @@ public:
|
|||||||
int32_t NotifyDataChange(const RdbSyncerParam& param, const RdbChangedData &clientChangedData,
|
int32_t NotifyDataChange(const RdbSyncerParam& param, const RdbChangedData &clientChangedData,
|
||||||
uint32_t delay = 0) override;
|
uint32_t delay = 0) override;
|
||||||
|
|
||||||
|
int32_t SetSearchable(const RdbSyncerParam& param, bool isSearchable) override;
|
||||||
|
|
||||||
std::pair<int32_t, std::shared_ptr<ResultSet>> QuerySharingResource(const RdbSyncerParam ¶m,
|
std::pair<int32_t, std::shared_ptr<ResultSet>> QuerySharingResource(const RdbSyncerParam ¶m,
|
||||||
const PredicatesMemo &predicates, const std::vector<std::string> &columns) override;
|
const PredicatesMemo &predicates, const std::vector<std::string> &columns) override;
|
||||||
int32_t Disable(const RdbSyncerParam& param) override;
|
int32_t Disable(const RdbSyncerParam& param) override;
|
||||||
|
@ -176,6 +176,8 @@ public:
|
|||||||
|
|
||||||
int Notify(const std::string &event) override;
|
int Notify(const std::string &event) override;
|
||||||
|
|
||||||
|
int SetSearchable(bool isSearchable) override;
|
||||||
|
|
||||||
ModifyTime GetModifyTime(const std::string& table, const std::string& columnName,
|
ModifyTime GetModifyTime(const std::string& table, const std::string& columnName,
|
||||||
std::vector<PRIKey>& keys) override;
|
std::vector<PRIKey>& keys) override;
|
||||||
|
|
||||||
|
@ -498,6 +498,19 @@ void RdbServiceProxy::OnSyncComplete(const std::string &storeName, Details &&res
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t RdbServiceProxy::SetSearchable(const RdbSyncerParam& param, bool isSearchable)
|
||||||
|
{
|
||||||
|
MessageParcel reply;
|
||||||
|
int32_t status = IPC_SEND(static_cast<uint32_t>(RdbServiceCode::RDB_SERVICE_CMD_SET_SEARCHABLE),
|
||||||
|
reply, param, isSearchable);
|
||||||
|
if (status != RDB_OK) {
|
||||||
|
LOG_ERROR("RdbServiceProxy SetSearchable fail, status:%{public}d, "
|
||||||
|
"bundleName:%{public}s, storeName:%{public}s",
|
||||||
|
status, param.bundleName_.c_str(), SqliteUtils::Anonymous(param.storeName_).c_str());
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
int32_t RdbServiceProxy::NotifyDataChange(const RdbSyncerParam ¶m, const RdbChangedData &rdbChangedData,
|
int32_t RdbServiceProxy::NotifyDataChange(const RdbSyncerParam ¶m, const RdbChangedData &rdbChangedData,
|
||||||
uint32_t delay)
|
uint32_t delay)
|
||||||
{
|
{
|
||||||
|
@ -2170,6 +2170,16 @@ int RdbStoreImpl::Notify(const std::string &event)
|
|||||||
return E_OK;
|
return E_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int RdbStoreImpl::SetSearchable(bool isSearchable)
|
||||||
|
{
|
||||||
|
auto [errCode, service] = DistributedRdb::RdbManagerImpl::GetInstance().GetRdbService(syncerParam_);
|
||||||
|
if (errCode != E_OK || service == nullptr) {
|
||||||
|
LOG_ERROR("GetRdbService is failed, err is %{public}d.", errCode);
|
||||||
|
return errCode;
|
||||||
|
}
|
||||||
|
return service->SetSearchable(syncerParam_, isSearchable);
|
||||||
|
}
|
||||||
|
|
||||||
int RdbStoreImpl::RegisterAutoSyncCallback(std::shared_ptr<DetailProgressObserver> observer)
|
int RdbStoreImpl::RegisterAutoSyncCallback(std::shared_ptr<DetailProgressObserver> observer)
|
||||||
{
|
{
|
||||||
if (config_.GetDBType() == DB_VECTOR) {
|
if (config_.GetDBType() == DB_VECTOR) {
|
||||||
|
@ -79,6 +79,7 @@ enum class RdbServiceInterfaceCode {
|
|||||||
RDB_SERVICE_CMD_REGISTER_AUTOSYNC_PROGRESS_OBSERVER,
|
RDB_SERVICE_CMD_REGISTER_AUTOSYNC_PROGRESS_OBSERVER,
|
||||||
RDB_SERVICE_CMD_UNREGISTER_AUTOSYNC_PROGRESS_OBSERVER,
|
RDB_SERVICE_CMD_UNREGISTER_AUTOSYNC_PROGRESS_OBSERVER,
|
||||||
RDB_SERVICE_CMD_NOTIFY_DATA_CHANGE,
|
RDB_SERVICE_CMD_NOTIFY_DATA_CHANGE,
|
||||||
|
RDB_SERVICE_CMD_SET_SEARCHABLE,
|
||||||
RDB_SERVICE_CMD_QUERY_SHARING_RESOURCE,
|
RDB_SERVICE_CMD_QUERY_SHARING_RESOURCE,
|
||||||
RDB_SERVICE_CMD_DISABLE,
|
RDB_SERVICE_CMD_DISABLE,
|
||||||
RDB_SERVICE_CMD_ENABLE,
|
RDB_SERVICE_CMD_ENABLE,
|
||||||
|
@ -76,6 +76,8 @@ public:
|
|||||||
virtual int32_t NotifyDataChange(
|
virtual int32_t NotifyDataChange(
|
||||||
const RdbSyncerParam ¶m, const RdbChangedData &rdbChangedData, uint32_t delay = 0) = 0;
|
const RdbSyncerParam ¶m, const RdbChangedData &rdbChangedData, uint32_t delay = 0) = 0;
|
||||||
|
|
||||||
|
virtual int32_t SetSearchable(const RdbSyncerParam& param, bool isSearchable) = 0;
|
||||||
|
|
||||||
virtual int32_t Disable(const RdbSyncerParam ¶m) = 0;
|
virtual int32_t Disable(const RdbSyncerParam ¶m) = 0;
|
||||||
|
|
||||||
virtual int32_t Enable(const RdbSyncerParam ¶m) = 0;
|
virtual int32_t Enable(const RdbSyncerParam ¶m) = 0;
|
||||||
|
@ -664,6 +664,16 @@ public:
|
|||||||
{
|
{
|
||||||
return E_ERROR;
|
return E_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set search enable or disable.
|
||||||
|
*
|
||||||
|
* @param isSearchable Indicates enable or disable.
|
||||||
|
*/
|
||||||
|
virtual int SetSearchable(bool isSearchable)
|
||||||
|
{
|
||||||
|
return E_ERROR;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
} // namespace OHOS::NativeRdb
|
} // namespace OHOS::NativeRdb
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user