summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorGravatar Vincent Rischmann2024-12-14 01:38:19 +0100
committerGravatar Vincent Rischmann2024-12-14 01:38:19 +0100
commitd1e3865115aa5f27c6c75e8061277e898d155210 (patch)
treeebc0b996cb6331ce700fa84b4bbf6866878c2979 /README.md
parentreadme: fix typo (diff)
downloadzig-sqlite-d1e3865115aa5f27c6c75e8061277e898d155210.tar.gz
zig-sqlite-d1e3865115aa5f27c6c75e8061277e898d155210.tar.xz
zig-sqlite-d1e3865115aa5f27c6c75e8061277e898d155210.zip
readme: fix examples
Diffstat (limited to '')
-rw-r--r--README.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/README.md b/README.md
index afc1cd1..c58434e 100644
--- a/README.md
+++ b/README.md
@@ -625,12 +625,14 @@ try db.createAggregateFunction(
625 "mySum", 625 "mySum",
626 &my_ctx, 626 &my_ctx,
627 struct { 627 struct {
628 fn step(ctx: *MyContext, input: u32) void { 628 fn step(fctx: sqlite.FunctionContext, input: u32) void {
629 var ctx = fctx.userContext(*MyContext) orelse return;
629 ctx.sum += input; 630 ctx.sum += input;
630 } 631 }
631 }.step, 632 }.step,
632 struct { 633 struct {
633 fn finalize(ctx: *MyContext) u32 { 634 fn finalize(fctx: sqlite.FunctionContext) u32 {
635 const ctx = fctx.userContext(*MyContext) orelse return 0;
634 return ctx.sum; 636 return ctx.sum;
635 } 637 }
636 }.finalize, 638 }.finalize,