This commit is contained in:
parent
db6b019b5d
commit
8dede5fad6
2 changed files with 4 additions and 4 deletions
|
@ -196,14 +196,14 @@ pub fn RepositoryInsert(comptime Model: type, comptime TableShape: type, comptim
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set selected columns for RETURNING clause.
|
/// 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) {
|
if (_select.len == 0) {
|
||||||
return ZrmError.AtLeastOneSelectionRequired;
|
return ZrmError.AtLeastOneSelectionRequired;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.returning(.{
|
self.returning(.{
|
||||||
// Join selected columns.
|
// 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.
|
.params = &[_]_sql.RawQueryParameter{}, // No parameters.
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,14 +153,14 @@ pub fn RepositoryUpdate(comptime Model: type, comptime TableShape: type, comptim
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set selected columns for RETURNING clause.
|
/// 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) {
|
if (_select.len == 0) {
|
||||||
return ZrmError.AtLeastOneSelectionRequired;
|
return ZrmError.AtLeastOneSelectionRequired;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.returning(.{
|
self.returning(.{
|
||||||
// Join selected columns.
|
// 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.
|
.params = &[_]_sql.RawQueryParameter{}, // No parameters.
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue