You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
D1PreparedStatement is just a statement, which has not been executed actually. However, user could make mistake by writing code like this:
query!(&self.db,"DELETE FROM users WHERE id = ?", id)?;// correct version: query!(&self.db, "DELETE FROM users WHERE id = ?", id)?.all().await?
This code does not work, D1PreparedStatement just like a Future in Rust. It wouldn't been executed automatically, it must been called explicitly .
I suggest that we could implement IntoFuture for D1PreparedStatement, so that we can execute a statement by await it directly. What's more, D1PreparedStatement need to been attributed as #[must_use], to avoid misuse statically.