diff options
| author | 2020-10-25 01:18:49 +0200 | |
|---|---|---|
| committer | 2020-10-25 01:18:49 +0200 | |
| commit | 1f10f1b5797f18fddce8b47cd00bfcfc800420b1 (patch) | |
| tree | 609cd10061753f1425815d185776f2c5bbc60c38 /sqlite.zig | |
| parent | add the Bytes type (diff) | |
| download | zig-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.zig | 17 |
1 files changed, 12 insertions, 5 deletions
| @@ -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 | ||