Skip to content

Commit 4632471

Browse files
committed
refactor(core): rename PgConnectionInfo to ConnectionExt
Signed-off-by: Atkins Chang <[email protected]>
1 parent 38435ca commit 4632471

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

sqlx-core/src/postgres/connection/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -178,18 +178,18 @@ impl Connection for PgConnection {
178178
}
179179
}
180180

181-
pub trait PgConnectionInfo {
181+
pub trait ConnectionExt {
182182
/// the version number of the server in `libpq` format
183183
fn server_version_num(&self) -> Option<u32>;
184184
}
185185

186-
impl PgConnectionInfo for PgConnection {
186+
impl ConnectionExt for PgConnection {
187187
fn server_version_num(&self) -> Option<u32> {
188188
self.stream.server_version_num
189189
}
190190
}
191191

192-
impl PgConnectionInfo for crate::pool::PoolConnection<Postgres> {
192+
impl ConnectionExt for crate::pool::PoolConnection<Postgres> {
193193
fn server_version_num(&self) -> Option<u32> {
194194
self.stream.server_version_num
195195
}

sqlx-core/src/postgres/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ mod migrate;
2222

2323
pub use arguments::{PgArgumentBuffer, PgArguments};
2424
pub use column::PgColumn;
25-
pub use connection::{PgConnection, PgConnectionInfo};
25+
pub use connection::{ConnectionExt, PgConnection};
2626
pub use database::Postgres;
2727
pub use error::{PgDatabaseError, PgErrorPosition};
2828
pub use listener::{PgListener, PgNotification};

tests/postgres/postgres.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use futures::TryStreamExt;
22
use sqlx::postgres::{
33
PgConnectOptions, PgConnection, PgDatabaseError, PgErrorPosition, PgSeverity,
44
};
5-
use sqlx::postgres::{PgConnectionInfo, PgPoolOptions, PgRow, Postgres};
5+
use sqlx::postgres::{PgPoolOptions, PgRow, Postgres};
66
use sqlx::{Column, Connection, Executor, Row, Statement, TypeInfo};
77
use sqlx_test::{new, setup_if_needed};
88
use std::env;
@@ -968,6 +968,8 @@ async fn test_listener_cleanup() -> anyhow::Result<()> {
968968

969969
#[sqlx_macros::test]
970970
async fn it_supports_domain_types_in_composite_domain_types() -> anyhow::Result<()> {
971+
use sqlx::postgres::ConnectionExt;
972+
971973
// Only supported in Postgres 11+
972974
let mut conn = new::<Postgres>().await?;
973975
if matches!(conn.server_version_num(), Some(version) if version < 110000) {
@@ -1096,7 +1098,7 @@ CREATE TABLE heating_bills (
10961098

10971099
#[sqlx_macros::test]
10981100
async fn test_pg_server_num() -> anyhow::Result<()> {
1099-
use sqlx::postgres::PgConnectionInfo;
1101+
use sqlx::postgres::ConnectionExt;
11001102

11011103
let conn = new::<Postgres>().await?;
11021104

0 commit comments

Comments
 (0)