Referencing to

PgPoolOptions's connect(&str) expects a database connection string. In order to adapt log level I have to switch to PgConnectOptions which expects single fields for username, password, host etc.. Therefore it would be nice if PgPoolOptions supports setting a log level via options.log_statements(LevelFilter::Trace); the same way as PgConnectOptions does. Otherwise people have to adapt their configs as well.


All ConnectOptions types implement FromStr so you can parse it from the database URL and then modify options as you see fit.

let mut opts: PgConnectOptions = "<database URL>".parse()?;

Thanks, that helped.

© 2022 - All rights reserved.