21 ArgumentNullException.ThrowIfNull(connectionString);
23 return databaseType
switch
25 DatabaseType.MariaDB or DatabaseType.MySql =>
new MySqlConnection(connectionString),
26 DatabaseType.SqlServer =>
new SqlConnection(connectionString),
27 DatabaseType.Sqlite =>
new SqliteConnection(connectionString),
28 DatabaseType.PostgresSql =>
new NpgsqlConnection(connectionString),
29 _ =>
throw new ArgumentOutOfRangeException(nameof(databaseType), databaseType,
"Invalid DatabaseType!"),