duckdb / duckdb/duckdb-web

Add example code for traversing results in C++

Open
#1,024 4 comments 1 reaction 0 assignees View on GitHub
C++ developer docs
Dominant language
HTML
Stars
301
Forks
595
Avg merge
23h 41m
Merged PRs (30d)
58

Description

The https://duckdb.org/docs/api/cpp.html page says:

> The `MaterializedQueryResult` instance contains firstly two fields that indicate whether the query was successful. `Query` will not throw exceptions under normal circumstances. Instead, invalid queries or other issues will lead to the `success` boolean field in the query result instance to be set to `false`. In this case an error message may be available in `error` as a string. If successful, other fields are set: the type of statement that was just executed (e.g., `StatementType::INSERT_STATEMENT`) is contained in `statement_type`. The high-level ("SQL type") types of the result set columns are in `sql_types` and the low-level data representation types are in `types`. The names of the result columns are in the `names` string vector. In case multiple result sets are returned, for example because the result set contained multiple statements, the result set can be chained using the `next` field.
>
> ```c++
> // TODO
> ```

The code block should be completed. I removed it for the time being.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.