Skip to content

Commit b855518

Browse files
authored
Error in MySql implementation detail, related to features configuration, 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
1 parent 3fbd814 commit b855518

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

canyon_connection/src/canyon_database_connector.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ pub enum DatabaseType {
2828
impl From<&Auth> for DatabaseType {
2929
fn from(value: &Auth) -> Self {
3030
match value {
31+
#[cfg(feature = "postgres")]
3132
crate::datasources::Auth::Postgres(_) => DatabaseType::PostgreSql,
33+
#[cfg(feature = "mssql")]
3234
crate::datasources::Auth::SqlServer(_) => DatabaseType::SqlServer,
35+
#[cfg(feature = "mysql")]
3336
crate::datasources::Auth::MySQL(_) => DatabaseType::MySQL,
3437
}
3538
}

canyon_connection/src/datasources.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn load_ds_config_from_array() {
9292
assert_eq!(ds_1.properties.migrations, Some(Migrations::Disabled));
9393
}
9494
}
95-
///
95+
9696
#[derive(Deserialize, Debug, Clone)]
9797
pub struct CanyonSqlConfig {
9898
pub canyon_sql: Datasources,

canyon_connection/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ pub async fn init_connections_cache() {
8585
}
8686
}
8787

88-
///
8988
pub fn get_database_connection<'a>(
9089
datasource_name: &str,
9190
guarded_cache: &'a mut MutexGuard<IndexMap<&str, DatabaseConnection>>,

0 commit comments

Comments
 (0)