feat(oscar): add OSCAR database support
This commit is contained in:
1 parent
d3272b4750
commit
25dcbeb7e4
33 files changed
+204
-19
No files matched your search
@@ -312,6 +312,7 @@ pub enum DatabaseType {
|
||||
Bigquery,
|
||||
Kylin,
|
||||
Sundb,
|
||||
Oscar,
|
||||
Tdengine,
|
||||
Xugu,
|
||||
Iotdb,
|
||||
@@ -642,6 +643,7 @@ impl ConnectionConfig {
|
||||
DatabaseType::Kingbase | DatabaseType::Vastbase => Some("postgres"),
|
||||
DatabaseType::Highgo => Some("highgo"),
|
||||
DatabaseType::Yashandb => Some("yasdb"),
|
||||
DatabaseType::Oscar => Some("osrdb"),
|
||||
DatabaseType::Firebird => Some("employee"),
|
||||
DatabaseType::H2 => Some("test"),
|
||||
DatabaseType::Informix => Some("sysmaster"),
|
||||
@@ -796,6 +798,7 @@ impl ConnectionConfig {
|
||||
DatabaseType::Bigquery => format!("bigquery://{host}/{db_part}"),
|
||||
DatabaseType::Kylin => format!("kylin://{host}:{port}{db_part}"),
|
||||
DatabaseType::Sundb => format!("sundb://{host}:{port}{db_part}"),
|
||||
DatabaseType::Oscar => format!("oscar://{host}:{port}{db_part}"),
|
||||
DatabaseType::Tdengine => format!("tdengine://{host}:{port}{db_part}"),
|
||||
DatabaseType::Xugu => format!("xugu://{host}:{port}{db_part}"),
|
||||
DatabaseType::Iotdb => {
|
||||
@@ -998,6 +1001,9 @@ impl ConnectionConfig {
|
||||
DatabaseType::Sundb => {
|
||||
format!("sundb://{}:{}@{host}:{port}{db_part}", username, password)
|
||||
}
|
||||
DatabaseType::Oscar => {
|
||||
format!("oscar://{}:{}@{host}:{port}{db_part}", username, password)
|
||||
}
|
||||
DatabaseType::Tdengine => {
|
||||
format!("tdengine://{}:{}@{host}:{port}{db_part}", username, password)
|
||||
}
|
||||
@@ -2171,6 +2177,14 @@ mod tests {
|
||||
assert_eq!(config.connection_url(), "yashandb://sys:secret@10.1.2.3:2883/yasdb");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn oscar_url_defaults_to_osrdb_database() {
|
||||
let mut config = mysql_config("SYSDBA", "secret", None);
|
||||
config.db_type = DatabaseType::Oscar;
|
||||
|
||||
assert_eq!(config.connection_url(), "oscar://SYSDBA:secret@10.1.2.3:2883/osrdb");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mongodb_form_url_without_params_defaults_auth_source_to_admin() {
|
||||
let config = mongodb_config("root", "secret", Some("admin"));
|
||||
|
||||
Reference in new issue
Block a user