@@ -16,7 +16,8 @@ use crate::{
1616 Schema , ShardedTables ,
1717 } ,
1818 config:: {
19- General , MultiTenant , PoolerMode , ReadWriteSplit , ReadWriteStrategy , ShardedTable , User ,
19+ ConnectionRecovery , General , MultiTenant , PoolerMode , ReadWriteSplit , ReadWriteStrategy ,
20+ ShardedTable , User ,
2021 } ,
2122 net:: { messages:: BackendKeyData , Query } ,
2223} ;
@@ -59,6 +60,7 @@ pub struct Cluster {
5960 expanded_explain : bool ,
6061 pub_sub_channel_size : usize ,
6162 query_parser_enabled : bool ,
63+ connection_recovery : ConnectionRecovery ,
6264}
6365
6466/// Sharding configuration from the cluster.
@@ -107,6 +109,7 @@ pub struct ClusterConfig<'a> {
107109 pub expanded_explain : bool ,
108110 pub pub_sub_channel_size : usize ,
109111 pub query_parser_enabled : bool ,
112+ pub connection_recovery : ConnectionRecovery ,
110113}
111114
112115impl < ' a > ClusterConfig < ' a > {
@@ -146,6 +149,7 @@ impl<'a> ClusterConfig<'a> {
146149 expanded_explain : general. expanded_explain ,
147150 pub_sub_channel_size : general. pub_sub_channel_size ,
148151 query_parser_enabled : general. query_parser_enabled ,
152+ connection_recovery : general. connection_recovery ,
149153 }
150154 }
151155}
@@ -176,6 +180,7 @@ impl Cluster {
176180 expanded_explain,
177181 pub_sub_channel_size,
178182 query_parser_enabled,
183+ connection_recovery,
179184 } = config;
180185
181186 Self {
@@ -207,6 +212,7 @@ impl Cluster {
207212 expanded_explain,
208213 pub_sub_channel_size,
209214 query_parser_enabled,
215+ connection_recovery,
210216 }
211217 }
212218
@@ -304,6 +310,10 @@ impl Cluster {
304310 & self . prepared_statements
305311 }
306312
313+ pub fn connection_recovery ( & self ) -> & ConnectionRecovery {
314+ & self . connection_recovery
315+ }
316+
307317 pub fn dry_run ( & self ) -> bool {
308318 self . dry_run
309319 }
0 commit comments