1 /*
2  * Copyright (C) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "rdb_event_store_callback.h"
17 
18 #include "rdb_errno.h"
19 
20 #include "security_guard_log.h"
21 
22 namespace OHOS::Security::SecurityGuard {
OnCreate(NativeRdb::RdbStore & rdbStore)23 int RdbEventStoreCallback::OnCreate(NativeRdb::RdbStore &rdbStore)
24 {
25     SGLOGI("RdbEventStoreCallback::OnCreate");
26     int32_t ret = NativeRdb::E_ERROR;
27     size_t size = createTableSqlVec_.size();
28     if (size == 0) {
29         return ret;
30     }
31     for (size_t i = 0; i < createTableSqlVec_.size(); i++) {
32         ret = rdbStore.ExecuteSql(createTableSqlVec_[i]);
33     }
34     return ret;
35 }
36 
OnUpgrade(OHOS::NativeRdb::RdbStore & store,int32_t oldVersion,int32_t newVersion)37 int32_t RdbEventStoreCallback::OnUpgrade(OHOS::NativeRdb::RdbStore &store, int32_t oldVersion, int32_t newVersion)
38 {
39     SGLOGI("RdbEventStoreCallback::OnUpgrade");
40     (void)store;
41     (void)oldVersion;
42     (void)newVersion;
43     return NativeRdb::E_OK;
44 }
45 } // namespace OHOS::Security::SecurityGuard
46