From 4812cb461132129585343f5686ca5186d942c23d Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sun, 5 Jun 2011 13:01:28 -0700 Subject: [PATCH] Increased sqlite cache size to 30mb --- NzbDrone.Core/Datastore/Connection.cs | 2 +- NzbDrone.Core/Datastore/SqliteProvider.cs | 28 +++++++++++++++++++++++ NzbDrone.Core/NzbDrone.Core.csproj | 1 + 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 NzbDrone.Core/Datastore/SqliteProvider.cs diff --git a/NzbDrone.Core/Datastore/Connection.cs b/NzbDrone.Core/Datastore/Connection.cs index b717abd0f..9e2c836e5 100644 --- a/NzbDrone.Core/Datastore/Connection.cs +++ b/NzbDrone.Core/Datastore/Connection.cs @@ -20,7 +20,7 @@ namespace NzbDrone.Core.Datastore public static string GetConnectionString(string path) { - return String.Format("Data Source={0};Version=3;", path); + return String.Format("Data Source={0};Version=3;Cache Size=30000;", path); } public static String MainConnectionString diff --git a/NzbDrone.Core/Datastore/SqliteProvider.cs b/NzbDrone.Core/Datastore/SqliteProvider.cs new file mode 100644 index 000000000..b4b2e278c --- /dev/null +++ b/NzbDrone.Core/Datastore/SqliteProvider.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Migrator.Framework; +using Migrator.Providers.SQLite; + +namespace NzbDrone.Core.Datastore +{ + class SqliteProvider + { + private readonly ITransformationProvider _dataBase; + + public SqliteProvider(string connectionString) + { + _dataBase = new SQLiteTransformationProvider(new SQLiteDialect(), connectionString); + } + + + public int GetPageSize() + { + return Convert.ToInt32(_dataBase.ExecuteScalar("PRAGMA cache_size")); + } + + + + } +} diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index fb3009a98..69eff6d93 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -164,6 +164,7 @@ +