Skip to content

Commit d1e3865

Browse files
committed
readme: fix examples
1 parent 5f7181e commit d1e3865

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,12 +625,14 @@ try db.createAggregateFunction(
625625
"mySum",
626626
&my_ctx,
627627
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;
629630
ctx.sum += input;
630631
}
631632
}.step,
632633
struct {
633-
fn finalize(ctx: *MyContext) u32 {
634+
fn finalize(fctx: sqlite.FunctionContext) u32 {
635+
const ctx = fctx.userContext(*MyContext) orelse return 0;
634636
return ctx.sum;
635637
}
636638
}.finalize,

0 commit comments

Comments
 (0)