mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Added db4o.
Added guards against most problematic areas.
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Data.Common;
|
||||
using System.Data.SqlServerCe;
|
||||
using Db4objects.Db4o;
|
||||
using Db4objects.Db4o.IO;
|
||||
using Db4objects.Db4o.Internal;
|
||||
using Db4objects.Db4o.Internal.Config;
|
||||
using StackExchange.Profiling;
|
||||
using StackExchange.Profiling.Data;
|
||||
|
||||
@@ -23,4 +27,23 @@ namespace NzbDrone.Core.Datastore
|
||||
return connection;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ObjectDbSessionFactory
|
||||
{
|
||||
public IObjectDbSession Create(IStorage storage = null)
|
||||
{
|
||||
if (storage == null)
|
||||
{
|
||||
storage = new FileStorage();
|
||||
}
|
||||
|
||||
var config = Db4oEmbedded.NewConfiguration();
|
||||
config.File.Storage = storage;
|
||||
|
||||
|
||||
var objectContainer = Db4oEmbedded.OpenFile(config, "nzbdrone.db4o");
|
||||
return new ObjectDbSession((ObjectContainerBase)objectContainer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user