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
That behavior is by design, basically. Bolt is a stateful protocol and calling execute will return a RowStream that is in the READY state.
At this point, the server has parsed and validated the query, produced a plan and returned the result schema to the client. It is ready to produce results, but it's waiting for the client to be told to do so, which will happen on the first call to next. This streaming happens in chunks (config.fetch_size) and looping through all the calls to next ensures that all of those chunks are requested and executed on the server.
If you want to run a query for its side effects, you should use run instead of execute.
I am also adding must_use to RowStream, which would at least give you a warning:
warning: unused `RowStream` that must be used
--> lib/tests/result_stream.rs:27:5
|
27 | / graph
28 | | .execute(query("CREATE (n:MyNode {p: 'prop'})"))
29 | | .await
30 | | .unwrap();
| |_________________^
|
= note: Results must be streamed through with `next` in order to execute the query
= note: `#[warn(unused_must_use)]` on by default
version: 0.6.2
client.execute(query("create (n:MyNode {p: 'prop})")).await.unwrap();
returns with no error but also does nothing.
writes to the db as expected.
The text was updated successfully, but these errors were encountered: