Skip to content

Commit 3654d44

Browse files
committed
Say that column_count might panic
1 parent 6be725f commit 3654d44

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

crates/duckdb/src/column.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ impl Statement<'_> {
4949
/// If associated DB schema can be altered concurrently, you should make
5050
/// sure that current statement has already been stepped once before
5151
/// calling this method.
52+
///
53+
/// # Caveats
54+
/// Panics if the query has not been [`execute`](Statement::execute)d yet.
5255
#[inline]
5356
pub fn column_count(&self) -> usize {
5457
self.stmt.column_count()

crates/duckdb/src/raw_statement.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ impl RawStatement {
198198
}
199199
}
200200

201+
// FIXME(mlafeldt): This currently panics if the query has not been executed yet.
202+
// The C API doesn't have a function to get the column count without executing the query first.
201203
#[inline]
202204
pub fn column_count(&self) -> usize {
203205
unsafe { ffi::duckdb_arrow_column_count(self.result_unwrap()) as usize }

0 commit comments

Comments
 (0)