Fix compile errors on latest zig

This commit is contained in:
jaina heartles 2022-07-27 20:13:25 -07:00
parent ae9a062caf
commit f6f24a557e
3 changed files with 4 additions and 4 deletions

View file

@ -64,5 +64,5 @@ fn handleError(writer: anytype, err: anyerror) !void {
else => return err,
};
try writer.print("HTTP/1.1 {} {s}\r\n\r\n", .{ @enumToInt(status), status.phrase() });
try writer.print("HTTP/1.1 {} {?s}\r\n\r\n", .{ @enumToInt(status), status.phrase() });
}

View file

@ -46,8 +46,8 @@ const Query = struct {
comptime {
const order_expr = if (self.order_by == null) "" else comptimePrint(" ORDER BY {s}", .{join(self.order_by.?, ", ")});
const group_expr = if (self.group_by == null) "" else comptimePrint(" GROUP BY {s}", .{join(self.group_by.?, ", ")});
const limit_expr = if (self.limit == null) "" else comptimePrint(" LIMIT {}", .{self.limit});
const offset_expr = if (self.offset == null) "" else comptimePrint(" OFFSET {}", .{self.offset});
const limit_expr = if (self.limit == null) "" else comptimePrint(" LIMIT {?}", .{self.limit});
const offset_expr = if (self.offset == null) "" else comptimePrint(" OFFSET {?}", .{self.offset});
return comptimePrint(
"SELECT {s} FROM {s} WHERE {s}{s}{s}{s}{s};",
.{ join(self.select, ", "), self.from, self.where, order_expr, group_expr, limit_expr, offset_expr },

View file

@ -146,7 +146,7 @@ pub const PreparedStmt = struct {
else => |err| blk: {
std.log.debug("sql error {}: {s}", .{ err, c.sqlite3_errmsg(self.db) });
std.log.debug("Failed on SQL:\n==========\n{s}\n==========", .{self.getGeneratingSql()});
std.log.debug("Failed on SQL:\n==========\n{?s}\n==========", .{self.getGeneratingSql()});
break :blk error.UnknownError;
},
};