aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-11-11 15:37:53 -0500
committerGitHub <noreply@github.com>2016-11-11 15:37:53 -0500
commitb4c6cad2fa9256c4af83752a34679d2533c96b11 (patch)
tree43e25b4ed64a535823e21128ee74f3e0a1245069 /MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs
parent00316bc8ca9791f2ad68e84e29f2fbc6b1af2173 (diff)
parent2b19df9544315603673ff034e8fd621cf0b85a4b (diff)
Merge pull request #2281 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs53
1 files changed, 0 insertions, 53 deletions
diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs
deleted file mode 100644
index c273d49458..0000000000
--- a/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System;
-using System.Data;
-using System.Data.SQLite;
-using System.Threading.Tasks;
-using MediaBrowser.Model.Logging;
-
-namespace MediaBrowser.Server.Implementations.Persistence
-{
- /// <summary>
- /// Class SQLiteExtensions
- /// </summary>
- public static class SqliteExtensions
- {
- /// <summary>
- /// Connects to db.
- /// </summary>
- public static async Task<IDbConnection> ConnectToDb(string dbPath, bool isReadOnly, bool enablePooling, int? cacheSize, ILogger logger)
- {
- if (string.IsNullOrEmpty(dbPath))
- {
- throw new ArgumentNullException("dbPath");
- }
-
- SQLiteConnection.SetMemoryStatus(false);
-
- var connectionstr = new SQLiteConnectionStringBuilder
- {
- PageSize = 4096,
- CacheSize = cacheSize ?? 2000,
- SyncMode = SynchronizationModes.Normal,
- DataSource = dbPath,
- JournalMode = SQLiteJournalModeEnum.Wal,
-
- // This is causing crashing under linux
- Pooling = enablePooling && Environment.OSVersion.Platform == PlatformID.Win32NT,
- ReadOnly = isReadOnly
- };
-
- var connectionString = connectionstr.ConnectionString;
-
- if (!enablePooling)
- {
- logger.Info("Sqlite {0} opening {1}", SQLiteConnection.SQLiteVersion, connectionString);
- }
-
- var connection = new SQLiteConnection(connectionString);
-
- await connection.OpenAsync().ConfigureAwait(false);
-
- return connection;
- }
- }
-}