Add Database.cs with SQLite connection management and helper methods (Execute, ExecuteScalar, Query), Schema.cs for schema initialization, and replace default Program.cs with System.CommandLine v3 CLI featuring global --db/--schema options and an init command.
11 lines
219 B
C#
11 lines
219 B
C#
namespace NatsNet.PortTracker.Data;
|
|
|
|
public static class Schema
|
|
{
|
|
public static void Initialize(Database db, string schemaPath)
|
|
{
|
|
var sql = File.ReadAllText(schemaPath);
|
|
db.Execute(sql);
|
|
}
|
|
}
|