* @brief QueryResult stores the result of a query execution. */
| 23 | * @brief QueryResult stores the result of a query execution. |
| 24 | */ |
| 25 | class QueryResult { |
| 26 | public: |
| 27 | /** |
| 28 | * @brief Used to create a QueryResult object for the failing query. |
| 29 | */ |
| 30 | LBUG_API QueryResult(); |
| 31 | explicit QueryResult(QueryResultType type); |
| 32 | QueryResult(QueryResultType type, std::vector<std::string> columnNames, |
| 33 | std::vector<common::LogicalType> columnTypes); |
| 34 | |
| 35 | /** |
| 36 | * @brief Deconstructs the QueryResult object. |
| 37 | */ |
| 38 | LBUG_API virtual ~QueryResult() = 0; |
| 39 | /** |
| 40 | * @return if the query is executed successfully or not. |
| 41 | */ |
| 42 | LBUG_API bool isSuccess() const; |
| 43 | /** |
| 44 | * @return error message of the query execution if the query fails. |
| 45 | */ |
| 46 | LBUG_API std::string getErrorMessage() const; |
| 47 | /** |
| 48 | * @return number of columns in query result. |
| 49 | */ |
| 50 | LBUG_API size_t getNumColumns() const; |
| 51 | /** |
| 52 | * @return name of each column in the query result. |
| 53 | */ |
| 54 | LBUG_API std::vector<std::string> getColumnNames() const; |
| 55 | /** |
| 56 | * @return dataType of each column in the query result. |
| 57 | */ |
| 58 | LBUG_API std::vector<common::LogicalType> getColumnDataTypes() const; |
| 59 | /** |
| 60 | * @return query summary which stores the execution time, compiling time, plan and query |
| 61 | * options. |
| 62 | */ |
| 63 | LBUG_API QuerySummary* getQuerySummary() const; |
| 64 | QuerySummary* getQuerySummaryUnsafe(); |
| 65 | /** |
| 66 | * @return whether there are more query results to read. |
| 67 | */ |
| 68 | LBUG_API bool hasNextQueryResult() const; |
| 69 | /** |
| 70 | * @return get the next query result to read (for multiple query statements). |
| 71 | */ |
| 72 | LBUG_API QueryResult* getNextQueryResult(); |
| 73 | /** |
| 74 | * @return num of tuples in query result. |
| 75 | */ |
| 76 | LBUG_API virtual uint64_t getNumTuples() const = 0; |
| 77 | /** |
| 78 | * @return whether there are more tuples to read. |
| 79 | */ |
| 80 | LBUG_API virtual bool hasNext() const = 0; |
| 81 | /** |
| 82 | * @return next flat tuple in the query result. Note that to reduce resource allocation, all |
nothing calls this directly
no test coverage detected