Skip to content

Commit

Permalink
Merge pull request #98 from jamesmontemagno/litedb-5010
Browse files Browse the repository at this point in the history
Litedb
  • Loading branch information
jamesmontemagno authored Mar 13, 2022
2 parents 1bc68cf + dcf4447 commit b562ede
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/MonkeyCache.LiteDB/Barrel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class Barrel : IBarrel
{
public static string ApplicationId { get; set; } = string.Empty;
public static string EncryptionKey { get; set; } = string.Empty;
public static bool Upgrade { get; set; } = false;

static readonly Lazy<string> baseCacheDir = new Lazy<string>(() =>
{
Expand Down Expand Up @@ -64,6 +65,8 @@ public static IBarrel Create(string cacheDirectory, bool cache = false)
if (!string.IsNullOrWhiteSpace(EncryptionKey))
path = $"Filename={path}; Password={EncryptionKey}";
#endif
if(Upgrade)
path += "; Upgrade=true";

db = new LiteDatabase(path);
col = db.GetCollection<Banana>();
Expand Down Expand Up @@ -301,4 +304,4 @@ public void Empty(params string[] key)
}
#endregion
}
}
}
1 change: 1 addition & 0 deletions src/MonkeyCache.LiteDB/MonkeyCache.LiteDB.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
</PropertyGroup>



<ItemGroup>
<PackageReference Include="LiteDB" Version="5.0.11" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>
</Project>
2 changes: 1 addition & 1 deletion src/MonkeyCache.TestApp.UWP/MonkeyCache.TestApp.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,4 @@
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
</Project>
</Project>
2 changes: 1 addition & 1 deletion src/MonkeyCache.TestApp/MonkeyCache.TestApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
<DependentUpon>*.xaml</DependentUpon>
</Compile>
</ItemGroup>
</Project>
</Project>

0 comments on commit b562ede

Please sign in to comment.