File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ impl Statement<'_> {
49
49
/// If associated DB schema can be altered concurrently, you should make
50
50
/// sure that current statement has already been stepped once before
51
51
/// calling this method.
52
+ ///
53
+ /// # Caveats
54
+ /// Panics if the query has not been [`execute`](Statement::execute)d yet.
52
55
#[ inline]
53
56
pub fn column_count ( & self ) -> usize {
54
57
self . stmt . column_count ( )
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ impl RawStatement {
71
71
72
72
#[ inline]
73
73
pub fn result_unwrap ( & self ) -> ffi:: duckdb_arrow {
74
- self . result . unwrap ( )
74
+ self . result . expect ( "The statement was not executed yet" )
75
75
}
76
76
77
77
#[ inline]
@@ -198,6 +198,8 @@ impl RawStatement {
198
198
}
199
199
}
200
200
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.
201
203
#[ inline]
202
204
pub fn column_count ( & self ) -> usize {
203
205
unsafe { ffi:: duckdb_arrow_column_count ( self . result_unwrap ( ) ) as usize }
You can’t perform that action at this time.
0 commit comments