Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to add support for iterate() with SQLite statements #14361

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Skywalker13
Copy link

@Skywalker13 Skywalker13 commented Oct 4, 2024

What does this PR do?

  • Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

It's an attempt to add support for iterate() with SQLite statements
(like better-sqlite3 https://github.com/WiseLibs/better-sqlite3/blob/master/docs/api.md#iteratebindparameters---iterator)

Related issues:

These changes are based on the get and all implementations. It's the first time that I see JavaScriptCore stuff. For this feature, I use javascript generators in the wrapper bun:sqlite. I suppose that it should be better to implement in JavaScriptCore but honestly I'm not comfortable enough with it.

I hope that is a good start because IMHO it's an essential feature when working with very large databases.

How did you verify your code works?

  • I included a test for the new code, or existing tests cover it
  • I ran my tests locally and they pass (bun-debug test test-file-name.test)
bun-debug test test/js/bun/sqlite/sqlite.test.js

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.

Add SQLite cursor API SQLite Iterators Make sqlite Statement iterable
1 participant