- Notifications
You must be signed in to change notification settings - Fork516
Closed
Description
I try to get all statement's columns for logging, but fieldcolumns
is private. I usesimple_query
method because working withpgbouncer
.
use postgres::{Client,SimpleQueryMessage,No};use native_tls::{Certificate,TlsConnector};use postgres_native_tls::MakeTlsConnector;use std::fs;fnmain(){letmut client =Client::connect("...",NoTls).unwrap();let messages = client.simple_query("SELECT foo, bar FROM baz;").unwrap();match messages.first(){Some(SimpleQueryMessage::Row(msg)) =>{// field "columns" of struct "tokio_postgres::row::SimpleQueryRow" is privateprintln!("{}", msg.columns.join(" "))// TODO print all columns}, _ =>(),}}
Metadata
Metadata
Assignees
Labels
No labels