mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-17 07:49:45 +02:00
Simplify DatabaseType logic
(cherry picked from commit c5baded3d63a9e77e180023559758108c1ced782)
This commit is contained in:
parent
dc2759ddcb
commit
066d9dd1d4
@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Data.SQLite;
|
||||
using System.Text.RegularExpressions;
|
||||
using Dapper;
|
||||
using NLog;
|
||||
@ -39,17 +40,9 @@ public DatabaseType DatabaseType
|
||||
{
|
||||
get
|
||||
{
|
||||
using (var db = _datamapperFactory())
|
||||
{
|
||||
if (db.ConnectionString.Contains(".db"))
|
||||
{
|
||||
return DatabaseType.SQLite;
|
||||
}
|
||||
else
|
||||
{
|
||||
return DatabaseType.PostgreSQL;
|
||||
}
|
||||
}
|
||||
using var db = _datamapperFactory();
|
||||
|
||||
return db is SQLiteConnection ? DatabaseType.SQLite : DatabaseType.PostgreSQL;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user