Use Write-Ahead Logging

This commit is contained in:
ClemensFischer 2025-02-23 20:42:34 +01:00
parent 3b29c97bc6
commit 5f66d0d5e1

View file

@ -41,6 +41,11 @@ namespace MapControl.Caching
connection = new SQLiteConnection("Data Source=" + Path.GetFullPath(path));
connection.Open();
using (var command = new SQLiteCommand("PRAGMA journal_mode=WAL", connection))
{
command.ExecuteNonQuery();
}
using (var command = new SQLiteCommand("create table if not exists items (key text primary key, expiration integer, buffer blob)", connection))
{
command.ExecuteNonQuery();