@@ -396,6 +396,7 @@ struct InnerConnection {
396396 cancel_data : CancelData ,
397397 unknown_types : HashMap < Oid , Type > ,
398398 cached_statements : HashMap < String , CachedStatement > ,
399+ parameters : HashMap < String , String > ,
399400 next_stmt_id : u32 ,
400401 trans_depth : u32 ,
401402 canary : u32 ,
@@ -429,6 +430,7 @@ impl InnerConnection {
429430 cancel_data : CancelData { process_id : 0 , secret_key : 0 } ,
430431 unknown_types : HashMap :: new ( ) ,
431432 cached_statements : HashMap :: new ( ) ,
433+ parameters : HashMap :: new ( ) ,
432434 desynchronized : false ,
433435 finished : false ,
434436 trans_depth : 0 ,
@@ -512,7 +514,7 @@ impl InnerConnection {
512514 Ok ( None )
513515 }
514516 ParameterStatus { parameter, value } => {
515- debug ! ( "Parameter {} = {}" , parameter, value) ;
517+ self . parameters . insert ( parameter, value) ;
516518 Ok ( None )
517519 }
518520 val => Ok ( Some ( val) )
@@ -1108,6 +1110,11 @@ impl Connection {
11081110 self . conn . borrow ( ) . cancel_data
11091111 }
11101112
1113+ /// Returns the value of the specified parameter.
1114+ pub fn parameter ( & self , param : & str ) -> Option < String > {
1115+ self . conn . borrow ( ) . parameters . get ( param) . cloned ( )
1116+ }
1117+
11111118 /// Returns whether or not the stream has been desynchronized due to an
11121119 /// error in the communication channel with the server.
11131120 ///
@@ -1243,6 +1250,11 @@ impl<'conn> Transaction<'conn> {
12431250 } )
12441251 }
12451252
1253+ /// Returns a reference to the `Transaction`'s `Connection`.
1254+ pub fn connection ( & self ) -> & ' conn Connection {
1255+ self . conn
1256+ }
1257+
12461258 /// Like `Connection::is_active`.
12471259 pub fn is_active ( & self ) -> bool {
12481260 self . conn . conn . borrow ( ) . trans_depth == self . depth
0 commit comments