File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
sqlx-core/src/postgres/connection Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,11 @@ pub struct PgConnection {
65
65
}
66
66
67
67
impl PgConnection {
68
+ /// the version number of the server in `libpq` format
69
+ pub fn server_version_num ( & self ) -> Option < u32 > {
70
+ self . stream . server_version_num
71
+ }
72
+
68
73
// will return when the connection is ready for another query
69
74
async fn wait_until_ready ( & mut self ) -> Result < ( ) , Error > {
70
75
if !self . stream . wbuf . is_empty ( ) {
@@ -178,19 +183,24 @@ impl Connection for PgConnection {
178
183
}
179
184
}
180
185
186
+ #[ deprecated( since = "0.5.7" ) ]
181
187
pub trait PgConnectionInfo {
182
188
/// the version number of the server in `libpq` format
189
+ #[ deprecated(
190
+ since = "0.5.7" ,
191
+ note = "please use `server_version_num` from impl instead"
192
+ ) ]
183
193
fn server_version_num ( & self ) -> Option < u32 > ;
184
194
}
185
195
186
196
impl PgConnectionInfo for PgConnection {
187
197
fn server_version_num ( & self ) -> Option < u32 > {
188
- self . stream . server_version_num
198
+ self . server_version_num ( )
189
199
}
190
200
}
191
201
192
202
impl PgConnectionInfo for crate :: pool:: PoolConnection < Postgres > {
193
203
fn server_version_num ( & self ) -> Option < u32 > {
194
- self . stream . server_version_num
204
+ self . server_version_num ( )
195
205
}
196
206
}
You can’t perform that action at this time.
0 commit comments