Skip to content

Commit

Permalink
Rename textLen to columnBytes
Browse files Browse the repository at this point in the history
  • Loading branch information
karlseguin committed Nov 27, 2024
1 parent 49412a7 commit 9101f7a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/conn.zig
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ pub const Stmt = struct {
}
return self.textZ(index);
}
pub fn textLen(self: Stmt, index: usize) usize {
pub fn columnBytes(self: Stmt, index: usize) usize {
const stmt = self.stmt;
const c_index: c_int = @intCast(index);
return @intCast(c.sqlite3_column_bytes(stmt, c_index));
Expand Down Expand Up @@ -420,8 +420,8 @@ pub const Row = struct {
pub fn nullableTextZ(self: Row, col: usize) ?[*:0]const u8 {
return self.stmt.nullableTextZ(col);
}
pub fn textLen(self: Row, col: usize) usize {
return self.stmt.textLen(col);
pub fn columnBytes(self: Row, col: usize) usize {
return self.stmt.columnBytes(col);
}

pub fn blob(self: Row, col: usize) []const u8 {
Expand Down Expand Up @@ -716,8 +716,8 @@ test "blob/text" {

try t.expectEqualStrings(&d1, std.mem.span(row.textZ(2)));
try t.expectEqualStrings(&d2, std.mem.span(row.nullableTextZ(3).?));
try t.expectEqual(@as(usize, 4), row.textLen(2));
try t.expectEqual(@as(usize, 5), row.textLen(3));
try t.expectEqual(@as(usize, 4), row.columnBytes(2));
try t.expectEqual(@as(usize, 5), row.columnBytes(3));
}
}

Expand Down

0 comments on commit 9101f7a

Please sign in to comment.