Commit e2e89cb 1 parent 2cc3094 commit e2e89cb Copy full SHA for e2e89cb
File tree 1 file changed +14
-3
lines changed
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,24 @@ pub struct Info {
10
10
}
11
11
12
12
impl Info {
13
+ #[ deprecated( since = "4.1.0" , note = "Use Info::defaults() instead" ) ]
14
+ pub fn new ( ) -> Self {
15
+ Self :: default ( )
16
+ }
17
+
13
18
/**
14
19
* Returns the default connection options.
15
20
*
16
21
* See [PQconndefaults](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PQCONNDEFAULTS)
17
22
*/
18
- pub fn new ( ) -> Self {
19
- Self :: default ( )
23
+ pub fn defaults ( ) -> crate :: errors:: Result < Vec < Self > > {
24
+ unsafe {
25
+ let raw = pq_sys:: PQconndefaults ( ) ;
26
+ let info = Self :: vec_from_nta ( raw) ;
27
+ pq_sys:: PQconninfoFree ( raw) ;
28
+
29
+ info
30
+ }
20
31
}
21
32
22
33
/**
@@ -135,6 +146,6 @@ mod test {
135
146
136
147
#[ test]
137
148
fn defaults ( ) {
138
- let _ = crate :: connection:: Info :: default ( ) ;
149
+ let _ = crate :: connection:: Info :: defaults ( ) ;
139
150
}
140
151
}
You can’t perform that action at this time.
0 commit comments