summaryrefslogtreecommitdiff
path: root/sqlite.zig
diff options
context:
space:
mode:
authorGravatar Vincent Rischmann2020-10-29 20:28:20 +0100
committerGravatar Vincent Rischmann2020-10-29 20:28:20 +0100
commit75f1a04943cdf06b66fc7f991b459c31ae23a6ac (patch)
tree95411efbdf381c4e9ae71e37ca6426819c272f00 /sqlite.zig
parentMerge branch 'refactor-api' (diff)
downloadzig-sqlite-75f1a04943cdf06b66fc7f991b459c31ae23a6ac.tar.gz
zig-sqlite-75f1a04943cdf06b66fc7f991b459c31ae23a6ac.tar.xz
zig-sqlite-75f1a04943cdf06b66fc7f991b459c31ae23a6ac.zip
use an anonymous struct now that the compiler is fixed
Diffstat (limited to '')
-rw-r--r--sqlite.zig11
1 files changed, 2 insertions, 9 deletions
diff --git a/sqlite.zig b/sqlite.zig
index d140e56..d3df1a4 100644
--- a/sqlite.zig
+++ b/sqlite.zig
@@ -555,16 +555,9 @@ test "sqlite: statement exec" {
555 // Test with a Bytes struct 555 // Test with a Bytes struct
556 556
557 { 557 {
558 // NOTE(vincent): can't yet pass an anonymous struct, the compiler crashes. 558 try db.exec("INSERT INTO user(id, name, age) VALUES(?, ?, ?)", .{
559 const Params = struct {
560 id: usize,
561 name: Bytes,
562 age: usize,
563 };
564
565 try db.exec("INSERT INTO user(id, name, age) VALUES(?, ?, ?)", Params{
566 .id = 200, 559 .id = 200,
567 .name = .{ .Text = "hello" }, 560 .name = Bytes{ .Text = "hello" },
568 .age = 20, 561 .age = 20,
569 }); 562 });
570 } 563 }