aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Data/BaseSqliteRepository.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-11-19 13:09:15 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-11-19 13:09:15 -0500
commit5209ce9b2f7d2c56bca2c65966a5e2e7cc982133 (patch)
treea1c0e5d83a308869c58fa23cd79ff03474db3785 /Emby.Server.Implementations/Data/BaseSqliteRepository.cs
parentbdab0a1588fa4347d168c69f803a13cf607b4166 (diff)
stub out portable item repository
Diffstat (limited to 'Emby.Server.Implementations/Data/BaseSqliteRepository.cs')
-rw-r--r--Emby.Server.Implementations/Data/BaseSqliteRepository.cs31
1 files changed, 28 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs
index dc5d00985..6c1a96813 100644
--- a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs
+++ b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs
@@ -64,25 +64,50 @@ namespace Emby.Server.Implementations.Data
var db = SQLite3.Open(DbFilePath, connectionFlags, null);
- var queries = new[]
+ var queries = new List<string>
{
+ "pragma default_temp_store = memory",
"PRAGMA page_size=4096",
"PRAGMA journal_mode=WAL",
"PRAGMA temp_store=memory",
"PRAGMA synchronous=Normal",
//"PRAGMA cache size=-10000"
- };
+ };
+
+ var cacheSize = CacheSize;
+ if (cacheSize.HasValue)
+ {
+
+ }
+
+ if (EnableExclusiveMode)
+ {
+ queries.Add("PRAGMA locking_mode=EXCLUSIVE");
+ }
//foreach (var query in queries)
//{
// db.Execute(query);
//}
- db.ExecuteAll(string.Join(";", queries));
+ db.ExecuteAll(string.Join(";", queries.ToArray()));
return db;
}
+ protected virtual int? CacheSize
+ {
+ get
+ {
+ return null;
+ }
+ }
+
+ protected virtual bool EnableExclusiveMode
+ {
+ get { return false; }
+ }
+
internal static void CheckOk(int rc)
{
string msg = "";