summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-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,