@@ -63,6 +63,11 @@ impl<DB: Database> PoolOptions<DB> {
63
63
self
64
64
}
65
65
66
+ /// Get the maximum number of connections that this pool should maintain
67
+ pub fn get_max_connections ( & self ) -> u32 {
68
+ self . max_connections
69
+ }
70
+
66
71
/// Set the amount of time to attempt connecting to the database.
67
72
///
68
73
/// If this timeout elapses, [`Pool::acquire`] will return an error.
@@ -71,6 +76,11 @@ impl<DB: Database> PoolOptions<DB> {
71
76
self
72
77
}
73
78
79
+ /// Get the amount of time to attempt connecting to the database.
80
+ pub fn get_connect_timeout ( & self ) -> Duration {
81
+ self . connect_timeout
82
+ }
83
+
74
84
/// Set the minimum number of connections to maintain at all times.
75
85
///
76
86
/// When the pool is built, this many connections will be automatically spun up.
@@ -85,6 +95,11 @@ impl<DB: Database> PoolOptions<DB> {
85
95
self
86
96
}
87
97
98
+ /// Get the minimum number of connections to maintain at all times.
99
+ pub fn get_min_connections ( & self ) -> u32 {
100
+ self . min_connections
101
+ }
102
+
88
103
/// Set the maximum lifetime of individual connections.
89
104
///
90
105
/// Any connection with a lifetime greater than this will be closed.
@@ -104,6 +119,11 @@ impl<DB: Database> PoolOptions<DB> {
104
119
self
105
120
}
106
121
122
+ /// Get the maximum lifetime of individual connections.
123
+ pub fn get_max_lifetime ( & self ) -> Option < Duration > {
124
+ self . max_lifetime
125
+ }
126
+
107
127
/// Set a maximum idle duration for individual connections.
108
128
///
109
129
/// Any connection with an idle duration longer than this will be closed.
@@ -114,6 +134,11 @@ impl<DB: Database> PoolOptions<DB> {
114
134
self
115
135
}
116
136
137
+ /// Get the maximum idle duration for individual connections.
138
+ pub fn get_idle_timeout ( & self ) -> Option < Duration > {
139
+ self . idle_timeout
140
+ }
141
+
117
142
/// If true, the health of a connection will be verified by a call to [`Connection::ping`]
118
143
/// before returning the connection.
119
144
///
@@ -123,6 +148,11 @@ impl<DB: Database> PoolOptions<DB> {
123
148
self
124
149
}
125
150
151
+ /// Get's whether `test_before_acquire` is currently set.
152
+ pub fn get_test_before_acquire ( & self ) -> bool {
153
+ self . test_before_acquire
154
+ }
155
+
126
156
/// If set to `true`, calls to `acquire()` are fair and connections are issued
127
157
/// in first-come-first-serve order. If `false`, "drive-by" tasks may steal idle connections
128
158
/// ahead of tasks that have been waiting.
0 commit comments