mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 00:09:55 +09:00
Move database connection string operations local
In line with framework changes in https://github.com/ppy/osu-framework/pull/4793.
This commit is contained in:
@ -13,7 +13,7 @@ namespace osu.Game.Database
|
||||
{
|
||||
private readonly Storage storage;
|
||||
|
||||
private const string database_name = @"client";
|
||||
private const string database_name = @"client.db";
|
||||
|
||||
private ThreadLocal<OsuDbContext> threadContexts;
|
||||
|
||||
@ -139,7 +139,7 @@ namespace osu.Game.Database
|
||||
threadContexts = new ThreadLocal<OsuDbContext>(CreateContext, true);
|
||||
}
|
||||
|
||||
protected virtual OsuDbContext CreateContext() => new OsuDbContext(storage.GetDatabaseConnectionString(database_name))
|
||||
protected virtual OsuDbContext CreateContext() => new OsuDbContext(CreateDatabaseConnectionString(database_name, storage))
|
||||
{
|
||||
Database = { AutoTransactionsEnabled = false }
|
||||
};
|
||||
@ -152,7 +152,7 @@ namespace osu.Game.Database
|
||||
|
||||
try
|
||||
{
|
||||
storage.DeleteDatabase(database_name);
|
||||
storage.Delete(database_name);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@ -171,5 +171,7 @@ namespace osu.Game.Database
|
||||
|
||||
recycleThreadContexts();
|
||||
}
|
||||
|
||||
public static string CreateDatabaseConnectionString(string filename, Storage storage) => string.Concat("Data Source=", storage.GetFullPath($@"{filename}", true));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user