Function libduckdb_sys::duckdb_result_get_chunk
source · pub unsafe extern "C" fn duckdb_result_get_chunk(
result: duckdb_result,
chunk_index: idx_t
) -> duckdb_data_chunk
Expand description
Fetches a data chunk from the duckdb_result. This function should be called repeatedly until the result is exhausted.
The result must be destroyed with duckdb_destroy_data_chunk
.
This function supersedes all duckdb_value
functions, as well as the duckdb_column_data
and duckdb_nullmask_data
functions. It results in significantly better performance, and should be preferred in newer code-bases.
If this function is used, none of the other result functions can be used and vice versa (i.e. this function cannot be mixed with the legacy result functions).
Use duckdb_result_chunk_count
to figure out how many chunks there are in the result.
result: The result object to fetch the data chunk from.
chunk_index: The chunk index to fetch from.
returns: The resulting data chunk. Returns NULL
if the chunk index is out of bounds.