mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
Added PetaPoco
This commit is contained in:
parent
6355d5ada1
commit
63f6899894
43 changed files with 29270 additions and 85 deletions
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
using System.Data.SQLite;
|
||||
using System.IO;
|
||||
using MvcMiniProfiler.Data;
|
||||
using PetaPoco;
|
||||
using SubSonic.DataProviders;
|
||||
using SubSonic.DataProviders.SQLite;
|
||||
using SubSonic.Repository;
|
||||
|
@ -53,6 +55,16 @@ namespace NzbDrone.Core.Datastore
|
|||
return new SimpleRepository(GetDataProvider(connectionString), SimpleRepositoryOptions.RunMigrations);
|
||||
}
|
||||
|
||||
public static IDatabase GetPetaPocoDb(string connectionString)
|
||||
{
|
||||
var profileConnection = ProfiledDbConnection.Get(new SQLiteConnection(connectionString));
|
||||
PetaPoco.Database.Mapper = new CustomeMapper();
|
||||
var db = new PetaPoco.Database(profileConnection);
|
||||
db.OpenSharedConnection();
|
||||
|
||||
return db;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -67,6 +79,7 @@ namespace NzbDrone.Core.Datastore
|
|||
public override System.Data.Common.DbConnection CreateConnection(string connectionString)
|
||||
{
|
||||
return ProfiledDbConnection.Get(base.CreateConnection(connectionString));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue