Skip to content

Commit

Permalink
Error in MySql implementation detail, related to features configurati…
Browse files Browse the repository at this point in the history
…on, in From<&Auth> for DatabaseType (#61)

* changes: impl From<&Auth> for DatabaseType

* changes: correction cargo fmt

* changes: remove panic From<&Auth>

* changes: remove doc empty

* changes: cargo fmt
  • Loading branch information
0nSystem authored May 8, 2024
1 parent 3fbd814 commit b855518
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions canyon_connection/src/canyon_database_connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ pub enum DatabaseType {
impl From<&Auth> for DatabaseType {
fn from(value: &Auth) -> Self {
match value {
#[cfg(feature = "postgres")]
crate::datasources::Auth::Postgres(_) => DatabaseType::PostgreSql,
#[cfg(feature = "mssql")]
crate::datasources::Auth::SqlServer(_) => DatabaseType::SqlServer,
#[cfg(feature = "mysql")]
crate::datasources::Auth::MySQL(_) => DatabaseType::MySQL,
}
}
Expand Down
2 changes: 1 addition & 1 deletion canyon_connection/src/datasources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fn load_ds_config_from_array() {
assert_eq!(ds_1.properties.migrations, Some(Migrations::Disabled));
}
}
///

#[derive(Deserialize, Debug, Clone)]
pub struct CanyonSqlConfig {
pub canyon_sql: Datasources,
Expand Down
1 change: 0 additions & 1 deletion canyon_connection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ pub async fn init_connections_cache() {
}
}

///
pub fn get_database_connection<'a>(
datasource_name: &str,
guarded_cache: &'a mut MutexGuard<IndexMap<&str, DatabaseConnection>>,
Expand Down

0 comments on commit b855518

Please sign in to comment.