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

draft: Make iterate() lazy in JavaScript API #517

Closed
wants to merge 0 commits into from

Conversation

diegoreis42
Copy link
Contributor

Aims to solve #514

I'm marking this PR as a draft because I encountered an issue while trying to create a sqlite3 statement from a wasm statement.

In the wasm context, the limbo_core::Statement is wrapped in a RefCell, which makes it difficult to create a sqlite3 statement without transferring ownership. After some research, I found that in order to pass a reference to the Statement (instead of transferring ownership), I would need to modify the stmt signature in the sqlite3_stmt struct. This change would lead to further modifications beyond the scope of the current issue.

I’m not sure if this is a skill issue or if I’m missing something, but I’d appreciate any help or suggestions on how to resolve this problem.

@penberg
Copy link
Collaborator

penberg commented Dec 20, 2024

@diegoreis42 Perhaps the issue was not exact enough, but you should not import the sqlite3 crate (it's a thin wrapper to provide a C API). Instead, you should just use Rows::next_row() from core (which internally calls Statement::step().

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.

2 participants