Split the backend into API host, Domain, Application and Infrastructure projects. Add Swagger/OpenAPI per API version, Asp.Versioning (query/header), ProblemDetails with a global exception handler and SurrealQL migrations applied at startup (namespace/database ensured). Infrastructure owns the SurrealDB client, settings and DI.
28 lines
885 B
C#
28 lines
885 B
C#
namespace TarninaHub.Infrastructure.Settings;
|
|
|
|
public sealed class SurrealDbSettings
|
|
{
|
|
public string Namespace { get; set; } = "hubmi";
|
|
|
|
public string Database { get; set; } = "hubmi";
|
|
|
|
public string DataDirectory { get; set; } = "data";
|
|
|
|
/// <summary>
|
|
/// Directory (relative to the app base directory) with ordered *.surql
|
|
/// migration files applied at startup. Copied from backend/migrations.
|
|
/// </summary>
|
|
public string MigrationsDirectory { get; set; } = "migrations";
|
|
|
|
/// <summary>
|
|
/// When set (e.g. ws://127.0.0.1:8010/rpc), the backend connects to a
|
|
/// dedicated SurrealDB server instead of the embedded RocksDB engine.
|
|
/// The server must persist to ./data, not to memory.
|
|
/// </summary>
|
|
public string? RemoteUrl { get; set; }
|
|
|
|
public string? Username { get; set; }
|
|
|
|
public string? Password { get; set; }
|
|
}
|