@@ -141,6 +141,11 @@ impl<DB: Database> PoolOptions<DB> {
141
141
self
142
142
}
143
143
144
+ /// Get the maximum number of connections that this pool should maintain
145
+ pub fn get_max_connections ( & self ) -> u32 {
146
+ self . max_connections
147
+ }
148
+
144
149
/// Set the minimum number of connections to maintain at all times.
145
150
///
146
151
/// When the pool is built, this many connections will be automatically spun up.
@@ -168,6 +173,11 @@ impl<DB: Database> PoolOptions<DB> {
168
173
self
169
174
}
170
175
176
+ /// Get the minimum number of connections to maintain at all times.
177
+ pub fn get_min_connections ( & self ) -> u32 {
178
+ self . min_connections
179
+ }
180
+
171
181
/// Set the maximum amount of time to spend waiting for a connection in [`Pool::acquire()`].
172
182
///
173
183
/// Caps the total amount of time `Pool::acquire()` can spend waiting across multiple phases:
@@ -186,6 +196,11 @@ impl<DB: Database> PoolOptions<DB> {
186
196
self
187
197
}
188
198
199
+ /// Get the maximum amount of time to spend waiting for a connection in [`Pool::acquire()`].
200
+ pub fn get_acquire_timeout ( & self ) -> Duration {
201
+ self . acquire_timeout
202
+ }
203
+
189
204
/// Set the maximum lifetime of individual connections.
190
205
///
191
206
/// Any connection with a lifetime greater than this will be closed.
@@ -205,6 +220,11 @@ impl<DB: Database> PoolOptions<DB> {
205
220
self
206
221
}
207
222
223
+ /// Get the maximum lifetime of individual connections.
224
+ pub fn get_max_lifetime ( & self ) -> Option < Duration > {
225
+ self . max_lifetime
226
+ }
227
+
208
228
/// Set a maximum idle duration for individual connections.
209
229
///
210
230
/// Any connection that remains in the idle queue longer than this will be closed.
@@ -215,6 +235,11 @@ impl<DB: Database> PoolOptions<DB> {
215
235
self
216
236
}
217
237
238
+ /// Get the maximum idle duration for individual connections.
239
+ pub fn get_idle_timeout ( & self ) -> Option < Duration > {
240
+ self . idle_timeout
241
+ }
242
+
218
243
/// If true, the health of a connection will be verified by a call to [`Connection::ping`]
219
244
/// before returning the connection.
220
245
///
@@ -224,6 +249,11 @@ impl<DB: Database> PoolOptions<DB> {
224
249
self
225
250
}
226
251
252
+ /// Get's whether `test_before_acquire` is currently set.
253
+ pub fn get_test_before_acquire ( & self ) -> bool {
254
+ self . test_before_acquire
255
+ }
256
+
227
257
/// If set to `true`, calls to `acquire()` are fair and connections are issued
228
258
/// in first-come-first-serve order. If `false`, "drive-by" tasks may steal idle connections
229
259
/// ahead of tasks that have been waiting.
0 commit comments