Skip to content

Commit 63685d0

Browse files
committed
Make all ConnectOptions clonable
1 parent d901694 commit 63685d0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sqlx-core/src/any/options.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::mssql::MssqlConnectOptions;
2626
/// postgres://postgres:password@localhost/database
2727
/// mysql://root:password@localhost/database
2828
/// ```
29-
#[derive(Debug)]
29+
#[derive(Debug, Clone)]
3030
pub struct AnyConnectOptions(pub(crate) AnyConnectOptionsKind);
3131

3232
impl AnyConnectOptions {
@@ -47,7 +47,7 @@ impl AnyConnectOptions {
4747
}
4848
}
4949

50-
#[derive(Debug)]
50+
#[derive(Debug, Clone)]
5151
pub(crate) enum AnyConnectOptionsKind {
5252
#[cfg(feature = "postgres")]
5353
Postgres(PgConnectOptions),

sqlx-core/src/connection.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl LogSettings {
152152
}
153153
}
154154

155-
pub trait ConnectOptions: 'static + Send + Sync + FromStr<Err = Error> + Debug {
155+
pub trait ConnectOptions: 'static + Send + Sync + FromStr<Err = Error> + Debug + Clone {
156156
type Connection: Connection + ?Sized;
157157

158158
/// Establish a new database connection with the options specified by `self`.

0 commit comments

Comments
 (0)