Skip to content

Use iterators for getOne and getMaybeOne functions - #55

Merged
robinheghan merged 2 commits into
gren-lang:mainfrom
joeybright:improve-sqlite-get-one-efficiency
Aug 8, 2026
Merged

Use iterators for getOne and getMaybeOne functions#55
robinheghan merged 2 commits into
gren-lang:mainfrom
joeybright:improve-sqlite-get-one-efficiency

Conversation

@joeybright

Copy link
Copy Markdown
Contributor

Fixes #44

Use iterators to avoid getting many rows from the database when you only want one. Applies to getOne and getMaybeOne functions. Preserves count of returned rows when failing due to multiple results by looping through the iterator. Nothing else remarkable about the code!

All tests are passing for me locally, with no new tests added.

@robinheghan robinheghan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great.

@robinheghan
robinheghan merged commit 5097fb0 into gren-lang:main Aug 8, 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: Improve efficiency of getOne and getMaybeOne

2 participants