diff options
| author | 2024-12-14 01:38:19 +0100 | |
|---|---|---|
| committer | 2024-12-14 01:38:19 +0100 | |
| commit | d1e3865115aa5f27c6c75e8061277e898d155210 (patch) | |
| tree | ebc0b996cb6331ce700fa84b4bbf6866878c2979 /README.md | |
| parent | readme: fix typo (diff) | |
| download | zig-sqlite-d1e3865115aa5f27c6c75e8061277e898d155210.tar.gz zig-sqlite-d1e3865115aa5f27c6c75e8061277e898d155210.tar.xz zig-sqlite-d1e3865115aa5f27c6c75e8061277e898d155210.zip | |
readme: fix examples
Diffstat (limited to '')
| -rw-r--r-- | README.md | 6 |
1 files changed, 4 insertions, 2 deletions
| @@ -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, |