Compare commits

..

3 commits
v0.3.1 ... main

Author SHA1 Message Date
8dede5fad6
Fix returningColumns.
All checks were successful
/ build_docs (push) Successful in 30s
2025-01-14 11:52:10 +01:00
db6b019b5d
Add auto docs build with repository actions. 2025-01-14 11:48:47 +01:00
20360fc412
Add docs artifact build script. 2025-01-13 00:07:42 +01:00
3 changed files with 28 additions and 4 deletions

View file

@ -0,0 +1,24 @@
on:
push:
tags:
- "*"
jobs:
build_docs:
runs-on: docker
container:
image: docker.zeptotech.net/zeptotech/zig-yarn:1.1.0
credentials:
username: ${{ vars.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
steps:
- uses: actions/checkout@v4
- run: mkdir -p artifact/api
- run: (cd docs && corepack enable && yarn install)
- run: (cd docs && yarn docs:build)
- run: mv docs/.vitepress/dist/* artifact
- run: /zig/zig build docs
- run: mv zig-out/docs/* artifact/api
- uses: https://code.forgejo.org/forgejo/upload-artifact@v4
with:
name: docs.zip
path: artifact

View file

@ -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.
});
}

View file

@ -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.
});
}