feat(drivers): add YashanDB built-in support
This commit is contained in:
1 parent
57dea3cb6d
commit
fb9582fd2c
13 files changed
+39
No files matched your search
@@ -128,6 +128,7 @@ pub enum DatabaseType {
|
||||
Vastbase,
|
||||
Goldendb,
|
||||
Gaussdb,
|
||||
Yashandb,
|
||||
Access,
|
||||
#[serde(rename = "h2")]
|
||||
H2,
|
||||
@@ -175,6 +176,7 @@ impl ConnectionConfig {
|
||||
DatabaseType::Gaussdb => Some("postgres"),
|
||||
DatabaseType::Kingbase | DatabaseType::Vastbase => Some("postgres"),
|
||||
DatabaseType::Highgo => Some("highgo"),
|
||||
DatabaseType::Yashandb => Some("yasdb"),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@@ -267,6 +269,7 @@ impl ConnectionConfig {
|
||||
DatabaseType::Vastbase => format!("vastbase://{host}:{port}{db_part}"),
|
||||
DatabaseType::Goldendb => format!("goldendb://{host}:{port}{db_part}"),
|
||||
DatabaseType::Gaussdb => format!("gaussdb://{host}:{port}{db_part}"),
|
||||
DatabaseType::Yashandb => format!("yashandb://{host}:{port}{db_part}"),
|
||||
DatabaseType::H2 => format!("h2://{host}:{port}{db_part}"),
|
||||
DatabaseType::Snowflake => format!("snowflake://{host}/{db_part}"),
|
||||
DatabaseType::Trino => format!("trino://{host}:{port}{db_part}"),
|
||||
@@ -366,6 +369,9 @@ impl ConnectionConfig {
|
||||
DatabaseType::Gaussdb => {
|
||||
format!("gaussdb://{}:{}@{host}:{port}{db_part}", username, password)
|
||||
}
|
||||
DatabaseType::Yashandb => {
|
||||
format!("yashandb://{}:{}@{host}:{port}{db_part}", username, password)
|
||||
}
|
||||
DatabaseType::H2 => {
|
||||
format!("h2://{}:{}@{host}:{port}{db_part}", username, password)
|
||||
}
|
||||
@@ -816,6 +822,14 @@ mod tests {
|
||||
assert_eq!(config.connection_url(), "gaussdb://gaussdb:secret@10.1.2.3:2883/postgres");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn yashandb_url_defaults_to_yasdb_database() {
|
||||
let mut config = mysql_config("sys", "secret", None);
|
||||
config.db_type = DatabaseType::Yashandb;
|
||||
|
||||
assert_eq!(config.connection_url(), "yashandb://sys:secret@10.1.2.3:2883/yasdb");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mongodb_form_url_without_params_does_not_force_topology_or_auth() {
|
||||
let config = mongodb_config("root", "secret", Some("admin"));
|
||||
|
||||
Reference in new issue
Block a user