1/*
2 * Copyright (C) 2021 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_base_callback.h"
17
18#include "data_storage_log_wrapper.h"
19#include "rdb_errno.h"
20#include "rdb_store.h"
21
22namespace OHOS {
23namespace Telephony {
24int RdbBaseCallBack::OnCreate(NativeRdb::RdbStore &rdbStore)
25{
26    DATA_STORAGE_LOGI("Data_Storage RdbBaseCallBack::OnCreate\n");
27    int32_t ret = NativeRdb::E_ERROR;
28    size_t size = createTableVec_.size();
29    if (size == 0) {
30        return ret;
31    }
32    for (size_t i = 0; i < createTableVec_.size(); i++) {
33        ret = rdbStore.ExecuteSql(createTableVec_[i]);
34    }
35    return ret;
36}
37} // namespace Telephony
38} // namespace OHOS
39