Skip to content

Commit

Permalink
query: values() should check field types
Browse files Browse the repository at this point in the history
  • Loading branch information
cztomsik committed Aug 22, 2024
1 parent fc907d4 commit db55b7b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/query.zig
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ pub fn Query(comptime T: type, comptime R: type) type {
}

pub fn values(self: Q, data: anytype) Q {
comptime util.checkFields(T, @TypeOf(data));

return self.append(.values, comptime "(" ++ util.columns(@TypeOf(data)) ++ ") VALUES (" ++ util.placeholders(@TypeOf(data)) ++ ")", data);
}

Expand Down

0 comments on commit db55b7b

Please sign in to comment.