Skip to content

Commit 6956cef

Browse files
authored
Prefer to give real data to .bind() in README.md (#4257)
Using undefined `user_email` and `user_name` left me confused, because: 1. I was not aware of their types 2. I didn't know where they did come from Passing real values seem to be more correct and more readable :)
1 parent 45ba990 commit 6956cef

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ use futures_util::TryStreamExt;
334334
use sqlx::Row;
335335

336336
let mut rows = sqlx::query("SELECT * FROM users WHERE email = ?")
337-
.bind(email)
337+
.bind("user@example.com")
338338
.fetch(&mut conn);
339339

340340
while let Some(row) = rows.try_next().await? {
@@ -358,8 +358,8 @@ let mut stream = sqlx::query("SELECT * FROM users")
358358
struct User { name: String, id: i64 }
359359

360360
let mut stream = sqlx::query_as::<_, User>("SELECT * FROM users WHERE email = ? OR name = ?")
361-
.bind(user_email)
362-
.bind(user_name)
361+
.bind("user@example.com")
362+
.bind("example_username")
363363
.fetch(&mut conn);
364364
```
365365

0 commit comments

Comments
 (0)