Commit 21590d5 1 parent 664d576 commit 21590d5 Copy full SHA for 21590d5
File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -435,6 +435,16 @@ impl<DB: Database> Pool<DB> {
435
435
pub fn num_idle ( & self ) -> usize {
436
436
self . 0 . num_idle ( )
437
437
}
438
+
439
+ /// Get the connection options for this pool
440
+ pub fn connect_options ( & self ) -> & <DB :: Connection as Connection >:: Options {
441
+ & self . 0 . connect_options
442
+ }
443
+
444
+ /// Get the options for this pool
445
+ pub fn options ( & self ) -> & PoolOptions < DB > {
446
+ & self . 0 . options
447
+ }
438
448
}
439
449
440
450
#[ cfg( all(
Original file line number Diff line number Diff line change @@ -260,6 +260,20 @@ impl PgConnectOptions {
260
260
self
261
261
}
262
262
263
+ /// Get the current database name.
264
+ ///
265
+ /// # Example
266
+ ///
267
+ /// ```rust
268
+ /// # use sqlx_core::postgres::PgConnectOptions;
269
+ /// let options = PgConnectOptions::new()
270
+ /// .database("postgres");
271
+ /// assert!(options.get_database().is_some());
272
+ /// ```
273
+ pub fn get_database ( & self ) -> Option < & str > {
274
+ self . database . as_deref ( )
275
+ }
276
+
263
277
/// Sets whether or with what priority a secure SSL TCP/IP connection will be negotiated
264
278
/// with the server.
265
279
///
You can’t perform that action at this time.
0 commit comments