Skip to content

Implement Sqlite.foldl - #56

Merged
robinheghan merged 2 commits into
gren-lang:mainfrom
joeybright:implement-sqlite-foldl
Aug 9, 2026
Merged

Implement Sqlite.foldl#56
robinheghan merged 2 commits into
gren-lang:mainfrom
joeybright:implement-sqlite-foldl

Conversation

@joeybright

Copy link
Copy Markdown
Contributor

Fixes #45

  • Implements the Sqlite.foldl function.
  • Replaces Sqlite.getAll implementation with foldl. The previous kernel implementation mutated an array in place. This rewrite uses Array.Builder to (hopefully) avoid any performance issues creating an array in Gren vs. Js.
  • Adds tests to ensure foldl works as expected. Given that getAll has been rewritten to use foldl, all previous tests that use getAll are also tests for foldl, too.

- Implements the `Sqlite.foldl` function
- Replaces `Sqlite.getAll` implementation with `foldl`. Uses `Array.Builder` to (hopefully) avoid any performance issues of using immutable arrays for larger query result sets vs. the previous kernel implementation which mutated an array in place
- Adds tests to ensure `Sqlite.foldl` works as expected
@joeybright joeybright changed the title Implement sqlite foldl Implement Sqlite.foldl Aug 8, 2026
@robinheghan
robinheghan merged commit cc425fd into gren-lang:main Aug 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sqlite: introduce Sqlite.foldl

2 participants