Proxfield.Extensions.Caching.SQLite 0.2.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package Proxfield.Extensions.Caching.SQLite --version 0.2.5
NuGet\Install-Package Proxfield.Extensions.Caching.SQLite -Version 0.2.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Proxfield.Extensions.Caching.SQLite" Version="0.2.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Proxfield.Extensions.Caching.SQLite --version 0.2.5
#r "nuget: Proxfield.Extensions.Caching.SQLite, 0.2.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Proxfield.Extensions.Caching.SQLite as a Cake Addin
#addin nuget:?package=Proxfield.Extensions.Caching.SQLite&version=0.2.5

// Install Proxfield.Extensions.Caching.SQLite as a Cake Tool
#tool nuget:?package=Proxfield.Extensions.Caching.SQLite&version=0.2.5

GitHub License Version Actions Nuget GitHub branch checks state GitHub code size in bytes NuGet Downloads

SQLite Caching Library

The SQLite Caching Library is layer for caching data on SQLite to be used as a secondary database in case of failures and network inconsistences.

Nuget

PM> Install-Package Proxfield.Extensions.Caching.SQLite

How

This caching library is based on the "Microsoft.Extensions.Caching.Redis" for memory caching, but instead of using Redis it uses the SQLite as a data layer. The ideia is to be a library for persistence cache in case of failures. This library uses the "Microsoft.Data" and acts as a layer above the SQLite.

Usage

The initialization can be either by using Microsoft's dependency injection or a common initialization.

Common Initialization

var cache = new SQLiteCache(options =>
{
    options.Location = @"c:\cache\database.sqlite";
});

Dependency Injection Initialization

services.AddSQLiteCache(options => {
    options.Location = @"c:\cache\database.sqlite";
});

Methods available

The caching can be recorded/retrieved as a simple string

this.cache.SetAsString("users/1", "jose");
var user = this.cache.GetAsString("users/1");

Or either as a complex object:

this.cache.SetAsObject<User>("users/1", new User() { Name = "Jose" });
var user = this.cache.GetAsObject<User>("users/1");

The following list constains all methods avaliable currently on the library.

Method Description
byte[] Get(string key);
Task<byte[]> GetAsync(string key);
void Set(string key, byte[] value);
Task SetAsync(string key, byte[] value);
void Remove(string key);
Task RemoveAsync(string key);
void SetAsString(string key, string value);
void SetAsObject<T>(string key, T value);
string GetAsString(string key);
T? GetAsObject<T>(string key);

Unit tests using Moq

Platform Support

SQLite Caching is compiled for DotNet 6, soon there will versions available for other plataforms.

  • DotNet 6
  • Windows 8
  • Windows Phone Silverlight 8
  • Windows Phone 8.1
  • Xamarin iOS
  • Xamarin Android

License

The MIT License (MIT)

Copyright (c) 2022 Proxfield

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Proxfield.Extensions.Caching.SQLite:

Package Downloads
Proxfield.Extensions.Caching.SQLite.DependencyInjection

The SQLite Caching Library is layer for caching data on SQLite to be used as a secondary database in case of failures and network inconsistences.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.3 257 8/10/2023
1.1.2 217 7/22/2023
1.1.1 207 7/22/2023
1.1.0 199 7/22/2023
1.0.4 711 9/22/2022
1.0.3 515 8/3/2022
1.0.2 500 8/3/2022
1.0.1 509 8/3/2022
1.0.0 513 8/2/2022
0.3.4 532 7/29/2022
0.3.3 528 7/29/2022
0.3.2 553 7/20/2022
0.3.1 535 7/20/2022
0.3.0 527 7/20/2022
0.2.6 563 7/13/2022
0.2.5 562 7/13/2022
0.2.4 571 7/13/2022
0.2.3 542 7/12/2022
0.2.2 565 7/12/2022
0.2.1 428 7/12/2022
0.2.0 427 7/12/2022
0.1.0 421 7/12/2022