diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/db.zig | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -13,10 +13,14 @@ const Result = struct { c.duckdb_destroy_data_chunk(&self._chunk); } - pub fn getSize(self: Result) usize { + pub fn getRowCount(self: Result) usize { return c.duckdb_data_chunk_get_size(self._chunk); } + pub fn getColumnCount(self: Result) usize { + return c.duckdb_data_chunk_get_column_count(self._chunk); + } + pub fn fetchDataChunk(self: *Result) void{ self._chunk = c.duckdb_fetch_chunk(self._res); } @@ -92,5 +96,6 @@ test "Query size" { var result = try connection.query("SELECT * FROM integers;"); defer result.deinit(); - try std.testing.expect(3 == result.getSize()); + try std.testing.expect(3 == result.getRowCount()); + try std.testing.expect(2 == result.getColumnCount()); } |