From 8dede5fad61022e9171d288d22258afc7d49a04e Mon Sep 17 00:00:00 2001 From: Madeorsk Date: Tue, 14 Jan 2025 11:52:04 +0100 Subject: [PATCH] Fix returningColumns. --- src/insert.zig | 4 ++-- src/update.zig | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/insert.zig b/src/insert.zig index 55e00a7..fbe1c4a 100644 --- a/src/insert.zig +++ b/src/insert.zig @@ -196,14 +196,14 @@ pub fn RepositoryInsert(comptime Model: type, comptime TableShape: type, comptim } /// Set selected columns for RETURNING clause. - pub fn returningColumns(self: *Self, _select: []const []const u8) void { + pub fn returningColumns(self: *Self, _select: []const []const u8) !void { if (_select.len == 0) { return ZrmError.AtLeastOneSelectionRequired; } self.returning(.{ // Join selected columns. - .sql = std.mem.join(self.arena.allocator(), ", ", _select), + .sql = try std.mem.join(self.arena.allocator(), ", ", _select), .params = &[_]_sql.RawQueryParameter{}, // No parameters. }); } diff --git a/src/update.zig b/src/update.zig index 29f50fb..1bf922e 100644 --- a/src/update.zig +++ b/src/update.zig @@ -153,14 +153,14 @@ pub fn RepositoryUpdate(comptime Model: type, comptime TableShape: type, comptim } /// Set selected columns for RETURNING clause. - pub fn returningColumns(self: *Self, _select: []const []const u8) void { + pub fn returningColumns(self: *Self, _select: []const []const u8) !void { if (_select.len == 0) { return ZrmError.AtLeastOneSelectionRequired; } self.returning(.{ // Join selected columns. - .sql = std.mem.join(self.arena.allocator(), ", ", _select), + .sql = try std.mem.join(self.arena.allocator(), ", ", _select), .params = &[_]_sql.RawQueryParameter{}, // No parameters. }); }