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
The log_* methods in the sqlx::ConnectOptions trait are not usable, since they return &mut Self, while Pool::connect_with implementations require an owned reference of the *Option type.
Minimal Reproduction
use log::LevelFilter;use sqlx::{
postgres::{PgConnectOptions,PgPoolOptions,PgSslMode},ConnectOptions,PgPool,};pubasyncfnconnect() -> anyhow::Result<PgPool>{let connect_options = PgConnectOptions::new().log_statements(LevelFilter::Debug).host(
std::env::var("DATABASE_HOST").expect("env var DATABASE_HOST is required").as_ref(),).port(5432).username("postgres").password("password").ssl_mode(PgSslMode::Disable);// error: mismatched type, expects PgConnectOptions, is &mut PgConnectOptions.Ok(PgPool::connect_with(connect_options).await?)}
Info
SQLx version: 0.6.2
The text was updated successfully, but these errors were encountered:
Bug Description
The
log_*
methods in the sqlx::ConnectOptions trait are not usable, since they return&mut Self
, whilePool::connect_with
implementations require an owned reference of the*Option
type.Minimal Reproduction
Info
The text was updated successfully, but these errors were encountered: