1 /* 2 * Copyright (c) 2024 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 #ifndef OHOS_DISTRIBUTED_DATA_NATIVE_GDB_STATEMENT_H 17 #define OHOS_DISTRIBUTED_DATA_NATIVE_GDB_STATEMENT_H 18 #include <functional> 19 #include <memory> 20 #include <string> 21 #include <variant> 22 #include <vector> 23 24 #include "full_result.h" 25 26 namespace OHOS::DistributedDataAip { 27 /** 28 * @brief Indicates the column type. 29 * 30 * Value returned by getColumnType(int) 31 */ 32 enum class ColumnType : int { 33 TYPE_INTEGER = 0, 34 TYPE_FLOAT, 35 TYPE_TEXT, 36 TYPE_BLOB, 37 TYPE_FLOATVECTOR, 38 TYPE_JSONSTR, 39 TYPE_NULL, 40 }; 41 class Statement { 42 public: 43 virtual int32_t Prepare() = 0; 44 virtual int32_t Step() = 0; 45 virtual int32_t Finalize() = 0; 46 47 virtual uint32_t GetColumnCount() const = 0; 48 virtual std::pair<int32_t, std::string> GetColumnName(int32_t index) const = 0; 49 virtual std::pair<int32_t, ColumnType> GetColumnType(int32_t index) const = 0; 50 virtual std::pair<int32_t, GraphValue> GetColumnValue(int32_t index) const = 0; 51 52 virtual bool IsReady() const = 0; 53 }; 54 } // namespace OHOS::DistributedDataAip 55 #endif //ARKDATA_INTELLIGENCE_PLATFORM_STATEMENT_H