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] D1 EXISTS Query Fails to Parse Bool #689

Open
1 task done
cyypherus opened this issue Jan 2, 2025 · 0 comments
Open
1 task done

[BUG] D1 EXISTS Query Fails to Parse Bool #689

cyypherus opened this issue Jan 2, 2025 · 0 comments

Comments

@cyypherus
Copy link

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

Using .first with this type of query fails to parse the result as a bool.

db
        .prepare("SELECT EXISTS(SELECT 1 FROM users WHERE email = $1)")
        .bind(&[email.to_string().into()])
        .unwrap()
        .first::<bool>(None)
        .await

Steps To Reproduce

  1. Setup a d1 db with a schema that allows you to use an exists query
  2. Attempt to run the code in the description

Parsing fails

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