sfackler / rust-postgres

Native PostgreSQL driver for the Rust programming language
Apache License 2.0
3.43k stars 436 forks source link

Question: RowStream usage in async context #1047

Closed stevenliebregt closed 1 year ago

stevenliebregt commented 1 year ago

This may be a silly question but I can't manage to figure it out myself.

I am finding myself in need of using tokio_postgres and the query_raw(..) -> RowStream method for a "streaming" result.

Now I have the RowStream instance but I can't figure out how to actually get values out of it, what am I missing?

stevenliebregt commented 1 year ago

My apologies, I found how to do it by reading the docs a little better: https://docs.rs/tokio-postgres/latest/tokio_postgres/struct.Client.html#method.query_raw shows I need to use the pin_mut! and after that I can use try_next