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

[BUG]D1PreparedStatement::run and all documenation mismatch #690

Open
1 task done
robmv opened this issue Jan 3, 2025 · 0 comments
Open
1 task done

[BUG]D1PreparedStatement::run and all documenation mismatch #690

robmv opened this issue Jan 3, 2025 · 0 comments

Comments

@robmv
Copy link

robmv commented Jan 3, 2025

Is there an existing issue for this?

  • I have searched the existing issues

What version of workers-rs are you using?

0.5.0

What version of wrangler are you using?

3.99.0

Describe the bug

The Rust documentation for PreparedStatement::run say that it only returns metadata, In reality it is returning the result rows too, checking the run implementation and comparing it with all, and it invokes the respective JS native run and all implementations, but run does an extra step not done by all:

let result = cast_to_d1_error(result)?;

On the JS documentation side, it says that run and all should be treated as aliases, there is no mention of one only returning metadada, and as these are the basis of the Rust wrappers, the Rust side always returns the results too.

D1PreparedStatement::run is functionally equivalent to D1PreparedStatement::all, and can be treated as an alias.

Note: I wish the documentation clarified a little more when meta data fields aren't present, there are many Option metadata fields.

Steps To Reproduce

No response

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

No branches or pull requests

1 participant