Skip to content

Commit

Permalink
Merge pull request #138 from jamesmontemagno/autorebuild
Browse files Browse the repository at this point in the history
AutoRebuildEnabled litedb
  • Loading branch information
jamesmontemagno authored Mar 14, 2024
2 parents 785a467 + e0afd55 commit 5c84d3b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/MonkeyCache.LiteDB/Barrel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,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;
public static bool AutoRebuildEnabled { get; set; } = false;

static readonly Lazy<string> baseCacheDir = new Lazy<string>(() =>
{
Expand Down Expand Up @@ -67,6 +68,9 @@ public static IBarrel Create(string cacheDirectory, bool cache = false)
if(Upgrade)
path += "; Upgrade=true";

if (AutoRebuildEnabled)
path += "; auto-rebuild=true";

db = new LiteDatabase(path);
col = db.GetCollection<Banana>();
}
Expand Down
2 changes: 1 addition & 1 deletion src/MonkeyCache.LiteDB/MonkeyCache.LiteDB.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="LiteDB" Version="5.0.13" />
<PackageReference Include="LiteDB" Version="5.0.19" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/MonkeyCache.TestApp/MonkeyCache.TestApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LiteDB" Version="5.0.13" />
<PackageReference Include="LiteDB" Version="5.0.19" />
<PackageReference Include="sqlite-net-pcl" Version="1.8.116" />
<PackageReference Include="Xamarin.Forms" Version="2.5.0.122203" />
</ItemGroup>
Expand Down

0 comments on commit 5c84d3b

Please sign in to comment.