feat(porttracker): add DB access layer and init command
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.
This commit is contained in:
10
tools/NatsNet.PortTracker/Data/Schema.cs
Normal file
10
tools/NatsNet.PortTracker/Data/Schema.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace NatsNet.PortTracker.Data;
|
||||
|
||||
public static class Schema
|
||||
{
|
||||
public static void Initialize(Database db, string schemaPath)
|
||||
{
|
||||
var sql = File.ReadAllText(schemaPath);
|
||||
db.Execute(sql);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user