summaryrefslogtreecommitdiff
path: root/sqlite.zig
diff options
context:
space:
mode:
authorGravatar Vincent Rischmann2020-10-25 01:18:49 +0200
committerGravatar Vincent Rischmann2020-10-25 01:18:49 +0200
commit1f10f1b5797f18fddce8b47cd00bfcfc800420b1 (patch)
tree609cd10061753f1425815d185776f2c5bbc60c38 /sqlite.zig
parentadd the Bytes type (diff)
downloadzig-sqlite-1f10f1b5797f18fddce8b47cd00bfcfc800420b1.tar.gz
zig-sqlite-1f10f1b5797f18fddce8b47cd00bfcfc800420b1.tar.xz
zig-sqlite-1f10f1b5797f18fddce8b47cd00bfcfc800420b1.zip
fix test so that the compiler doesn't crash
Diffstat (limited to 'sqlite.zig')
-rw-r--r--sqlite.zig17
1 files changed, 12 insertions, 5 deletions
diff --git a/sqlite.zig b/sqlite.zig
index 3c9b162..e29977a 100644
--- a/sqlite.zig
+++ b/sqlite.zig
@@ -531,11 +531,18 @@ test "sqlite: statement exec" {
531 // Test with a Bytes struct 531 // Test with a Bytes struct
532 532
533 { 533 {
534 // try db.exec("INSERT INTO user(id, name, age) VALUES(?, ?, ?)", .{ 534 // NOTE(vincent): can't yet pass an anonymous struct, the compiler crashes.
535 // .id = 200, 535 const Params = struct {
536 // .name = Bytes{ .Text = "hello" }, 536 id: usize,
537 // .age = 20, 537 name: Bytes,
538 // }); 538 age: usize,
539 };
540
541 try db.exec("INSERT INTO user(id, name, age) VALUES(?, ?, ?)", Params{
542 .id = 200,
543 .name = .{ .Text = "hello" },
544 .age = 20,
545 });
539 } 546 }
540} 547}
541 548