Skip to content

Commit a813e5a

Browse files
add test case, switch from using a nullable to undefined
1 parent 36934f9 commit a813e5a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

query.zig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub fn ParsedQuery(comptime tmp_query: []const u8) type {
5656
// This holds the starting character of the string while
5757
// state is .inside_string so that we know which type of
5858
// string we're exiting from
59-
var string_starting_character: ?u8 = null;
59+
var string_starting_character: u8 = undefined;
6060

6161
var current_bind_marker_type: [256]u8 = undefined;
6262
var current_bind_marker_type_pos = 0;
@@ -452,6 +452,11 @@ test "parsed query: bind marker character inside string" {
452452
.exp_bind_markers = 1,
453453
.exp = "SELECT json_extract(metadata, '$.name') AS name FROM foobar WHERE name = $name",
454454
},
455+
.{
456+
.query = "SELECT json_extract(metadata, '$[0]') AS name FROM foobar",
457+
.exp_bind_markers = 0,
458+
.exp = "SELECT json_extract(metadata, '$[0]') AS name FROM foobar",
459+
},
455460
};
456461

457462
inline for (testCases) |tc| {

0 commit comments

Comments
 (0)