summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/db.zig9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/db.zig b/src/db.zig
index 9f9e22e..1b9f653 100644
--- a/src/db.zig
+++ b/src/db.zig
@@ -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());
}