VOOZH about

URL: https://www.nuget.org/packages/Akavache.Settings/11.4.1

โ‡ฑ NuGet Gallery | Akavache.Settings 11.4.1


๏ปฟ

๐Ÿ‘ Image
Akavache.Settings 11.4.1

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Akavache.Settings --version 11.4.1
 
 
NuGet\Install-Package Akavache.Settings -Version 11.4.1
 
 
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="Akavache.Settings" Version="11.4.1" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Akavache.Settings" Version="11.4.1" />
 
Directory.Packages.props
<PackageReference Include="Akavache.Settings" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Akavache.Settings --version 11.4.1
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Akavache.Settings, 11.4.1"
 
 
#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.
#:package Akavache.Settings@11.4.1
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Akavache.Settings&version=11.4.1
 
Install as a Cake Addin
#tool nuget:?package=Akavache.Settings&version=11.4.1
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

๐Ÿ‘ NuGet Stats
๐Ÿ‘ Build
๐Ÿ‘ Code Coverage
<br> <a href="https://www.nuget.org/packages/akavache.sqlite3"> <img src="https://img.shields.io/nuget/dt/akavache.sqlite3.svg"> </a> <a href="#backers"> <img src="https://opencollective.com/reactiveui/backers/badge.svg"> </a> <a href="#sponsors"> <img src="https://opencollective.com/reactiveui/sponsors/badge.svg"> </a> <a href="https://reactiveui.net/slack"> <img src="https://img.shields.io/badge/chat-slack-blue.svg"> </a>

<img alt="Akavache" src="https://raw.githubusercontent.com/reactiveui/styleguide/master/logo_akavache/main.png" width="150" />

Akavache V11.1: An Asynchronous Key-Value Store for Native Applications

Akavache is an asynchronous, persistent (i.e., writes to disk) key-value store created for writing desktop and mobile applications in C#, based on SQLite3. Akavache is great for both storing important data (i.e., user settings) as well as cached local data that expires.

What's New in V11.1

Akavache V11.1 introduces a new Builder Pattern for initialization, improved serialization support, and enhanced cross-serializer compatibility:

  • ๐Ÿ—๏ธ Builder Pattern: New fluent API for configuring cache instances
  • ๐Ÿ”„ Multiple Serializer Support: Choose between System.Text.Json, Newtonsoft.Json, each with a BSON variant
  • ๐Ÿ”— Cross-Serializer Compatibility: Read data written by different serializers
  • ๐Ÿงฉ Modular Design: Install only the packages you need
  • ๐Ÿ“ฑ Enhanced .NET MAUI Support: First-class support for .NET 9 cross-platform development
  • ๐Ÿ”’ Improved Security: Better encrypted cache implementation

Development History

Akavache V11.1 represents a significant evolution in the library's architecture, developed through extensive testing and community feedback in our incubator project. The new features and improvements in V11.1 were first prototyped and battle-tested in the ReactiveMarbles.CacheDatabase repository, which served as an experimental ground for exploring new caching concepts and architectural patterns.

Key Development Milestones:

  • ๐Ÿงช Incubation Phase: The builder pattern, modular serialization system, and enhanced API were first developed and tested in ReactiveMarbles.CacheDatabase
  • ๐Ÿ”ฌ Community Testing: Early adopters and contributors provided valuable feedback on the new architecture through real-world usage scenarios
  • ๐Ÿš€ Production Validation: The incubator project allowed us to validate performance improvements, API ergonomics, and cross-platform compatibility before integrating into Akavache
  • ๐Ÿ“ˆ Iterative Refinement: Multiple iterations based on community feedback helped shape the final V11.1 API design and feature set

This careful incubation process ensured that V11.1 delivers not just new features, but a more robust, flexible, and maintainable caching solution that builds upon years of community experience and testing.

Quick Start

1. Install Packages

<PackageReference Include="Akavache.Sqlite3" Version="11.1.*" />
<PackageReference Include="Akavache.SystemTextJson" Version="11.1.*" />

2. Initialize Akavache

Note: WithAkavache, WithAkavacheCacheDatabase and Initialize always requires an ISerializer defined as a generic type, such as WithAkavache<SystemJsonSerializer>. This ensures the cache instance is properly configured for serialization.

Static Initialization (Recommended for most apps)
using Akavache.Core;
using Akavache.SystemTextJson;
using Akavache.Sqlite3;
using Splat.Builder;

// Initialize with the builder pattern
AppBuilder.CreateSplatBuilder()
 .WithAkavacheCacheDatabase<SystemJsonSerializer>(builder =>
 builder.WithApplicationName("MyApp")
 .WithSqliteProvider() // REQUIRED: Explicitly initialize SQLite provider
 .WithSqliteDefaults());

Important: Always call WithSqliteProvider() explicitly before WithSqliteDefaults(). While WithSqliteDefaults() will automatically call WithSqliteProvider() if not already initialized (for backward compatibility), this automatic behavior is deprecated and may be removed in future versions. Explicit provider initialization is the recommended pattern for forward compatibility with other DI containers.

Dependency Injection Registration (for DI containers)
using Akavache.Core;
using Akavache.SystemTextJson;
using Akavache.Sqlite3;
using Splat.Builder;

// Example: Register Akavache with Splat DI
AppBuilder.CreateSplatBuilder()
 .WithAkavache<SystemJsonSerializer>(
 "MyApp",
 builder => builder.WithSqliteProvider() // REQUIRED: Explicit provider initialization
 .WithSqliteDefaults(),
 (splat, instance) => splat.RegisterLazySingleton(() => instance));

// For in-memory cache (testing or lightweight scenarios):
AppBuilder.CreateSplatBuilder()
 .WithAkavache<SystemJsonSerializer>(
 "Akavache",
 builder => builder.WithInMemoryDefaults(), // No provider needed for in-memory
 (splat, instance) => splat.RegisterLazySingleton(() => instance));

3. Use the Cache

Basic Operations
// Store an object
var user = new User { Name = "John", Email = "john@example.com" };
await CacheDatabase.UserAccount.InsertObject("current_user", user);

// Retrieve an object
var cachedUser = await CacheDatabase.UserAccount.GetObject<User>("current_user");

// Store with expiration
await CacheDatabase.LocalMachine.InsertObject("temp_data", someData, DateTimeOffset.Now.AddHours(1));

// Get or fetch pattern
var data = await CacheDatabase.LocalMachine.GetOrFetchObject("api_data", 
 async () => await httpClient.GetFromJsonAsync<ApiResponse>("https://api.example.com/data"));
Cache Types

Akavache provides four types of caches:

  • UserAccount: User settings and preferences that should persist and potentially sync
  • LocalMachine: Cached data that can be safely deleted by the system
  • Secure: Encrypted storage for sensitive data like credentials and API keys
  • InMemory: Temporary storage that doesn't persist between app sessions
// User preferences (persistent)
await CacheDatabase.UserAccount.InsertObject("user_settings", settings);

// API cache (temporary)
await CacheDatabase.LocalMachine.InsertObject("api_cache", apiData, DateTimeOffset.Now.AddHours(6));

// Sensitive data (encrypted)
await CacheDatabase.Secure.SaveLogin("john.doe", "secretPassword", "myapp.com");

// Session data (in-memory only)
await CacheDatabase.InMemory.InsertObject("current_session", sessionData);

Installation

Akavache V11.1 uses a modular package structure. Choose the packages that match your needs:

Core Package (In Memory only)

<PackageReference Include="Akavache" Version="11.1.*" />

Storage Backends (Choose One - Recommended)


<PackageReference Include="Akavache.Sqlite3" Version="11.1.*" />


<PackageReference Include="Akavache.EncryptedSqlite3" Version="11.1.*" />

Serializers (Choose One - Required)


<PackageReference Include="Akavache.SystemTextJson" Version="11.1.*" />


<PackageReference Include="Akavache.NewtonsoftJson" Version="11.1.*" />

Optional Extensions


<PackageReference Include="Akavache.Drawing" Version="11.1.*" />


<PackageReference Include="Akavache.Settings" Version="11.1.*" />

Framework Support

Akavache V11.1 supports:

  • โœ… .NET Framework 4.6.2/4.7.2 - Windows desktop applications
  • โœ… .NET Standard 2.0 - Cross-platform libraries
  • โœ… .NET 8.0 - Modern .NET applications
  • โœ… .NET 9.0 - Latest .NET applications
  • โœ… Mobile Targets - net9.0-android, net9.0-ios, net9.0-maccatalyst
  • โœ… Desktop Targets - net9.0-windows (WinUI), net9.0 (cross-platform)

Serializer Compatibility

Serializer .NET Framework 4.6.2+ .NET Standard 2.0 .NET 8.0+ Mobile Performance
System.Text.Json โœ… Via NuGet โœ… โœ… โœ… Fastest
Newtonsoft.Json โœ… Built-in โœ… โœ… โœ… Compatible

Recommendation: Use System.Text.Json for new projects for best performance. Use Newtonsoft.Json when migrating from older Akavache versions or when you need maximum compatibility.

Akavache.Settings: Configuration Made Easy

Akavache.Settings provides a specialized settings database for application configuration that survives app updates and reinstalls.

Quick Settings Example

using Akavache.Settings;

// 1. Create a settings class
public class AppSettings : SettingsBase
{
 public AppSettings() : base(nameof(AppSettings)) { }

 public bool EnableNotifications
 {
 get => GetOrCreate(true); // Default: true
 set => SetOrCreate(value);
 }

 public string UserName
 {
 get => GetOrCreate("DefaultUser");
 set => SetOrCreate(value);
 }

 public int MaxRetries
 {
 get => GetOrCreate(3);
 set => SetOrCreate(value);
 }
}

// 2. Initialize with your app
var appSettings = default(AppSettings);

AppBuilder.CreateSplatBuilder()
 .WithAkavache<SystemJsonSerializer>(builder =>
 builder.WithApplicationName("MyApp")
 .WithSqliteProvider()
 .WithSettingsStore<AppSettings>(settings => appSettings = settings));

// 3. Use the settings
appSettings.EnableNotifications = false;
appSettings.UserName = "John Doe";
appSettings.MaxRetries = 5;

Console.WriteLine($"User: {appSettings.UserName}");
Console.WriteLine($"Notifications: {appSettings.EnableNotifications}");

Settings are automatically persisted and will survive app updates, making them perfect for user preferences and application configuration.

Documentation

๐Ÿ“š Complete documentation is available in the folder:

  • - Detailed installation and package selection
  • - Builder pattern, providers, and advanced setup
  • - System.Text.Json vs Newtonsoft.Json comparison
  • - UserAccount, LocalMachine, Secure, and InMemory caches
  • - CRUD operations and error handling
  • - Upgrading from V10.x to V11.1
  • - Complete Akavache.Settings guide
  • - Platform-specific guidance
  • - Benchmarks and optimization tips
  • - Recommended patterns and anti-patterns
  • - Common issues and solutions

Support and Contributing

Thanks

This project is tested with BrowserStack.

We want to thank the following contributors and libraries that help make Akavache possible:

Core Libraries

  • SQLite: sqlite-net-pcl and SQLitePCLRaw - Essential SQLite support for .NET
  • System.Reactive: Reactive Extensions for .NET - The foundation of Akavache's asynchronous API
  • Splat: Splat - Cross-platform utilities and service location
  • System.Text.Json: Microsoft's high-performance JSON serializer
  • Newtonsoft.Json: James Newton-King's Json.NET - The most popular .NET JSON library

Microsoft

<a href="https://dotnetfoundation.org"> <img src="https://theme.dotnetfoundation.org/img/logo.svg" width="100" /> </a>

We thank Microsoft for their ongoing support of the .NET ecosystem and the development tools that make Akavache possible.

License

Akavache is licensed under the .

Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-android35.0 net9.0-android35.0 is compatible.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-ios18.0 net9.0-ios18.0 is compatible.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-maccatalyst18.0 net9.0-maccatalyst18.0 is compatible.  net9.0-macos net9.0-macos was computed.  net9.0-macos15.0 net9.0-macos15.0 is compatible.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net9.0-windows10.0.17763 net9.0-windows10.0.17763 is compatible.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 was computed. 
.NET Framework net461 net461 was computed.  net462 net462 is compatible.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 is compatible.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos 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 Akavache.Settings:

Package Downloads
Shinya.Core

Shinya.Framework

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
12.1.1 1,741 6/3/2026
11.4.1 8,331 9/9/2025
11.3.3 224 9/6/2025
11.1.1 278 9/2/2025
11.0.1 390 8/24/2025