cloudflare / cloudflare/workers-rs
[BUG] D1 `EXISTS` Query Fails to Parse Bool
Open
- Dominant language
- Rust
- Stars
- 3.7k
- Forks
- 429
- Avg merge
- 20h 28m
- Merged PRs (30d)
- 7
Description
### Is there an existing issue for this?
- [X] 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.
```rust
db
.prepare("SELECT EXISTS(SELECT 1 FROM users WHERE email = $1)")
.bind(&[email.to_string().into()])
.unwrap()
.first::(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
Contributor guide
Assessment
This issue has not been assessed yet.