Premiere commit - Omika
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Omika.HfSqlProbe;
|
||||
|
||||
/// <summary>
|
||||
/// Root configuration for local HFSQL test databases.
|
||||
/// Never serialize this object — it contains credentials.
|
||||
/// </summary>
|
||||
public sealed class HfSqlTestConfiguration
|
||||
{
|
||||
[JsonPropertyName("Server")]
|
||||
public string Server { get; set; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("Port")]
|
||||
public int Port { get; set; }
|
||||
|
||||
[JsonPropertyName("Batik")]
|
||||
public HfSqlTestDatabaseConfiguration Batik { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("Omika")]
|
||||
public HfSqlTestDatabaseConfiguration Omika { get; set; } = new();
|
||||
|
||||
public HfSqlTestDatabaseConfiguration Resolve(string databaseKey)
|
||||
{
|
||||
return databaseKey.ToLowerInvariant() switch
|
||||
{
|
||||
"batik" => Batik,
|
||||
"omika" => Omika,
|
||||
_ => throw new ArgumentException(
|
||||
$"Unknown database key '{databaseKey}'. Expected 'batik' or 'omika'.")
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user