mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-20 21:54:25 -04:00
46c2e0ba82
Co-Authored-By: Qstick <376117+Qstick@users.noreply.github.com> Co-authored-by: ta264 <ta264@users.noreply.github.com> (cherry picked from commit 80b1aa9a2c81617bdda7ef551c19a2f114e49204)
38 lines
853 B
C#
38 lines
853 B
C#
using System;
|
|
using System.Data;
|
|
|
|
namespace NzbDrone.Core.Datastore
|
|
{
|
|
public interface IMainDatabase : IDatabase
|
|
{
|
|
}
|
|
|
|
public class MainDatabase : IMainDatabase
|
|
{
|
|
private readonly IDatabase _database;
|
|
private readonly DatabaseType _databaseType;
|
|
|
|
public MainDatabase(IDatabase database)
|
|
{
|
|
_database = database;
|
|
_databaseType = _database == null ? DatabaseType.SQLite : _database.DatabaseType;
|
|
}
|
|
|
|
public IDbConnection OpenConnection()
|
|
{
|
|
return _database.OpenConnection();
|
|
}
|
|
|
|
public Version Version => _database.Version;
|
|
|
|
public int Migration => _database.Migration;
|
|
|
|
public DatabaseType DatabaseType => _databaseType;
|
|
|
|
public void Vacuum()
|
|
{
|
|
_database.Vacuum();
|
|
}
|
|
}
|
|
}
|