Skip to content

Commit

Permalink
chore: add feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo-nakano-desu committed Jan 9, 2024
1 parent 1659467 commit 571b51d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/driver/sqlx_mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ impl std::fmt::Debug for SqlxMySqlPoolConnection {

impl SqlxMySqlConnector {
/// Check if the URI provided corresponds to `mysql://` for a MySQL database
#[cfg(feature = "mock")]
pub fn accepts(string: &str) -> bool {
string.starts_with("mysql://") && string.parse::<MySqlConnectOptions>().is_ok()
}
Expand Down
1 change: 1 addition & 0 deletions src/driver/sqlx_postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ impl std::fmt::Debug for SqlxPostgresPoolConnection {

impl SqlxPostgresConnector {
/// Check if the URI provided corresponds to `postgres://` for a PostgreSQL database
#[cfg(feature = "mock")]
pub fn accepts(string: &str) -> bool {
string.starts_with("postgres://") && string.parse::<PgConnectOptions>().is_ok()
}
Expand Down
1 change: 1 addition & 0 deletions src/driver/sqlx_sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ impl std::fmt::Debug for SqlxSqlitePoolConnection {

impl SqlxSqliteConnector {
/// Check if the URI provided corresponds to `sqlite:` for a SQLite database
#[cfg(feature = "mock")]
pub fn accepts(string: &str) -> bool {
string.starts_with("sqlite:") && string.parse::<SqliteConnectOptions>().is_ok()
}
Expand Down

0 comments on commit 571b51d

Please sign in to comment.