First version

This commit is contained in:
2026-03-19 23:11:13 +01:00
parent 7503d77c82
commit 8615d1de07
71 changed files with 3128 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
using SQLite;
using cfs_tracker.Models;
namespace cfs_tracker.Data;
public class AppDatabase
{
private SQLiteAsyncConnection? _database;
private bool _initialized;
public async Task InitAsync()
{
if (_initialized)
return;
var dbPath = Path.Combine(FileSystem.Current.AppDataDirectory, "mecfs_tracker.db3");
_database = new SQLiteAsyncConnection(dbPath);
await _database.CreateTableAsync<HealthEntry>();
_initialized = true;
}
public SQLiteAsyncConnection Connection =>
_database ?? throw new InvalidOperationException("Database not initialized.");
}