working with pgbouncer transactional mode
Closed this issue · 2 comments
is there any way to work with pgbouncer transactional mode( it doesnt allow prepared statements) according to docs and source code it should be simple_query method, but it doesnt have any documentation corresponding on how to use it with selects where i need to pull some data and put it in my predefined structs and types
i've tried to do some code like
let mut rows = self .pg .client .simple_query(&stmt) .await?;
`if let Some(SimpleQueryMessage::Row(row)) = rows.first() {
let storages_json = row.get(0).unwrap().to_string();`
and i never get Some of rows.first() its always else way, but rows is not empty in debug, is there any way or example maybe? or even better approach exists?
I believe, query_typed is what you need.
wow, its actually helped, thanks a lot! it was a bit unclear how to and when use this query, but it worked perfectly for me