Added migration tool

This commit is contained in:
Marius
2026-03-12 09:47:49 +02:00
parent 27648ae57c
commit b262d10ea4
35 changed files with 2579 additions and 2 deletions
@@ -0,0 +1,31 @@
namespace HaDbMigration.Configuration;
public sealed class MigrationOptions
{
public required string SqlitePath { get; init; }
public required string PostgresConnectionString { get; init; }
public int BatchSize { get; init; } = 10_000;
public bool Truncate { get; init; }
public bool DryRun { get; init; }
public void Validate()
{
if (!File.Exists(SqlitePath))
{
throw new FileNotFoundException(
$"SQLite database file not found: {SqlitePath}");
}
if (string.IsNullOrWhiteSpace(PostgresConnectionString))
{
throw new ArgumentException(
"PostgreSQL connection string is required.", nameof(PostgresConnectionString));
}
if (BatchSize < 100)
{
throw new ArgumentOutOfRangeException(
nameof(BatchSize), "Batch size must be at least 100.");
}
}
}