From 1f10f1b5797f18fddce8b47cd00bfcfc800420b1 Mon Sep 17 00:00:00 2001 From: Vincent Rischmann Date: Sun, 25 Oct 2020 01:18:49 +0200 Subject: fix test so that the compiler doesn't crash --- sqlite.zig | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'sqlite.zig') 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" { // Test with a Bytes struct { - // try db.exec("INSERT INTO user(id, name, age) VALUES(?, ?, ?)", .{ - // .id = 200, - // .name = Bytes{ .Text = "hello" }, - // .age = 20, - // }); + // NOTE(vincent): can't yet pass an anonymous struct, the compiler crashes. + const Params = struct { + id: usize, + name: Bytes, + age: usize, + }; + + try db.exec("INSERT INTO user(id, name, age) VALUES(?, ?, ?)", Params{ + .id = 200, + .name = .{ .Text = "hello" }, + .age = 20, + }); } } -- cgit v1.2.3