125c1cde8Sopenharmony_ci/* 225c1cde8Sopenharmony_ci * Copyright (C) 2021 Huawei Device Co., Ltd. 325c1cde8Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 425c1cde8Sopenharmony_ci * you may not use this file except in compliance with the License. 525c1cde8Sopenharmony_ci * You may obtain a copy of the License at 625c1cde8Sopenharmony_ci * 725c1cde8Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 825c1cde8Sopenharmony_ci * 925c1cde8Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1025c1cde8Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1125c1cde8Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1225c1cde8Sopenharmony_ci * See the License for the specific language governing permissions and 1325c1cde8Sopenharmony_ci * limitations under the License. 1425c1cde8Sopenharmony_ci */ 1525c1cde8Sopenharmony_ci 1625c1cde8Sopenharmony_ci#include "rdb_base_callback.h" 1725c1cde8Sopenharmony_ci 1825c1cde8Sopenharmony_ci#include "data_storage_log_wrapper.h" 1925c1cde8Sopenharmony_ci#include "rdb_errno.h" 2025c1cde8Sopenharmony_ci#include "rdb_store.h" 2125c1cde8Sopenharmony_ci 2225c1cde8Sopenharmony_cinamespace OHOS { 2325c1cde8Sopenharmony_cinamespace Telephony { 2425c1cde8Sopenharmony_ciint RdbBaseCallBack::OnCreate(NativeRdb::RdbStore &rdbStore) 2525c1cde8Sopenharmony_ci{ 2625c1cde8Sopenharmony_ci DATA_STORAGE_LOGI("Data_Storage RdbBaseCallBack::OnCreate\n"); 2725c1cde8Sopenharmony_ci int32_t ret = NativeRdb::E_ERROR; 2825c1cde8Sopenharmony_ci size_t size = createTableVec_.size(); 2925c1cde8Sopenharmony_ci if (size == 0) { 3025c1cde8Sopenharmony_ci return ret; 3125c1cde8Sopenharmony_ci } 3225c1cde8Sopenharmony_ci for (size_t i = 0; i < createTableVec_.size(); i++) { 3325c1cde8Sopenharmony_ci ret = rdbStore.ExecuteSql(createTableVec_[i]); 3425c1cde8Sopenharmony_ci } 3525c1cde8Sopenharmony_ci return ret; 3625c1cde8Sopenharmony_ci} 3725c1cde8Sopenharmony_ci} // namespace Telephony 3825c1cde8Sopenharmony_ci} // namespace OHOS 39