Skip to content

Commit b2bf805

Browse files
committed
refactor: extract driver name constants in domain database module
1 parent 21d9254 commit b2bf805

File tree

1 file changed

+8
-2
lines changed
  • src/domain/tracker/database

1 file changed

+8
-2
lines changed

src/domain/tracker/database/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ mod sqlite;
1919
pub use mysql::MysqlConfig;
2020
pub use sqlite::SqliteConfig;
2121

22+
/// `SQLite` driver name constant
23+
pub const DRIVER_SQLITE: &str = "sqlite3";
24+
25+
/// `MySQL` driver name constant
26+
pub const DRIVER_MYSQL: &str = "mysql";
27+
2228
/// Database configuration for Tracker
2329
///
2430
/// Supports multiple database backends. Currently implemented:
@@ -71,8 +77,8 @@ impl DatabaseConfig {
7177
#[must_use]
7278
pub fn driver_name(&self) -> &str {
7379
match self {
74-
Self::Sqlite(..) => "sqlite3",
75-
Self::Mysql(..) => "mysql",
80+
Self::Sqlite(..) => DRIVER_SQLITE,
81+
Self::Mysql(..) => DRIVER_MYSQL,
7682
}
7783
}
7884

0 commit comments

Comments
 (0)