Proxfield.Extensions.Caching.SQLite.DependencyInjection
0.2.6
See the version list below for details.
dotnet add package Proxfield.Extensions.Caching.SQLite.DependencyInjection --version 0.2.6
NuGet\Install-Package Proxfield.Extensions.Caching.SQLite.DependencyInjection -Version 0.2.6
<PackageReference Include="Proxfield.Extensions.Caching.SQLite.DependencyInjection" Version="0.2.6" />
<PackageVersion Include="Proxfield.Extensions.Caching.SQLite.DependencyInjection" Version="0.2.6" />
<PackageReference Include="Proxfield.Extensions.Caching.SQLite.DependencyInjection" />
paket add Proxfield.Extensions.Caching.SQLite.DependencyInjection --version 0.2.6
#r "nuget: Proxfield.Extensions.Caching.SQLite.DependencyInjection, 0.2.6"
#:package Proxfield.Extensions.Caching.SQLite.DependencyInjection@0.2.6
#addin nuget:?package=Proxfield.Extensions.Caching.SQLite.DependencyInjection&version=0.2.6
#tool nuget:?package=Proxfield.Extensions.Caching.SQLite.DependencyInjection&version=0.2.6
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
Visit out project at the Nuget Repository Page to know more.
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); | Retrieves a cached resource from the database |
| Task<byte[]> GetAsync(string key); | Retrieves a cached resource from the database as async |
| void Set(string key, byte[] value); | Sets a cached resource to the database |
| Task SetAsync(string key, byte[] value); | Sets a cached resource to the database async |
| void Remove(string key); | Removes a cached resource to the database |
| Task RemoveAsync(string key); | Removes a cached resource to the database as async |
| void SetAsString(string key, string value); | Sets an string into the the database |
| void SetAsObject<T>(string key, T value); | Sets an object into the the database |
| string GetAsString(string key); | Retrieves a string from the database |
| T? GetAsObject<T>(string key); | Retrieves an object from the database |
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 | Versions 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- Microsoft.Extensions.DependencyInjection (>= 6.0.0)
- Proxfield.Extensions.Caching.SQLite (>= 0.2.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.3 | 313 | 8/10/2023 |
| 1.1.2 | 295 | 7/22/2023 |
| 1.1.1 | 248 | 7/22/2023 |
| 1.1.0 | 255 | 7/22/2023 |
| 1.0.4 | 617 | 9/22/2022 |
| 1.0.3 | 559 | 8/3/2022 |
| 1.0.2 | 544 | 8/3/2022 |
| 1.0.1 | 541 | 8/3/2022 |
| 1.0.0 | 526 | 8/2/2022 |
| 0.3.4 | 549 | 7/29/2022 |
| 0.3.3 | 551 | 7/29/2022 |
| 0.3.2 | 574 | 7/20/2022 |
| 0.3.1 | 548 | 7/20/2022 |
| 0.3.0 | 577 | 7/20/2022 |
| 0.2.6 | 614 | 7/13/2022 |
| 0.2.5 | 618 | 7/13/2022 |
| 0.2.4 | 593 | 7/13/2022 |
| 0.2.3 | 587 | 7/12/2022 |
| 0.2.2 | 585 | 7/12/2022 |