Skip to main content

Allows users to cache values in a local sqlite database.

Total Downloads
5.6K
5,614
Published
Jun 14, 2023
3y ago

Get Started

dotnet add package ReactiveMarbles.CacheDatabase.Sqlite3 --version 1.3.1
ProductVersions
.NET
net6.0net7.0
.NET Standard
netstandard2.0

README

License Build

CacheDatabase

A reimplementation of Akavache using the SQLite framework by Frank Krueger.

ReactiveMarbles.CacheDatabase.EncryptedSqlite3 Nuget NuGet

ReactiveMarbles.CacheDatabase.Sqlite3 Nuget NuGet

CacheDatabase.Settings

A settings database for use with installable applications to provide persistent settings which are located one level down from the application folder making updates less painfull.

Example Application settings code

public class ViewSettings : SettingsBase
{
    /// <summary>
    /// Initializes a new instance of the <see cref="ViewSettings"/> class.
    /// </summary>
    public ViewSettings()
        : base(nameof(ViewSettings))
    {
    }

    /// <summary>
    /// Gets or sets a value indicating whether [bool test].
    /// </summary>
    /// <value>
    ///   <c>true</c> if [bool test]; otherwise, <c>false</c>.
    /// </value>
    public bool BoolTest
    {
        get => GetOrCreate(true); set => SetOrCreate(value);
    }

    /// <summary>
    /// Gets or sets the byte test.
    /// </summary>
    /// <value>
    /// The byte test.
    /// </value>
    public byte ByteTest
    {
        get => GetOrCreate((byte)123); set => SetOrCreate(value);
    }

    /// <summary>
    /// Gets or sets the short test.
    /// </summary>
    /// <value>
    /// The short test.
    /// </value>
    public short ShortTest
    {
        get => GetOrCreate((short)16); set => SetOrCreate(value);
    }

    /// <summary>
    /// Gets or sets the int test.
    /// </summary>
    /// <value>
    /// The int test.
    /// </value>
    public int IntTest
    {
        get => GetOrCreate(1); set => SetOrCreate(value);
    }

    /// <summary>
    /// Gets or sets the long test.
    /// </summary>
    /// <value>
    /// The long test.
    /// </value>
    public long LongTest
    {
        get => GetOrCreate(123456); set => SetOrCreate(value);
    }

    /// <summary>
    /// Gets or sets the string test.
    /// </summary>
    /// <value>
    /// The string test.
    /// </value>
    public string? StringTest
    {
        get => GetOrCreate("TestString"); set => SetOrCreate(value);
    }

    /// <summary>
    /// Gets or sets the float test.
    /// </summary>
    /// <value>
    /// The float test.
    /// </value>
    public float FloatTest
    {
        get => GetOrCreate(2.2f); set => SetOrCreate(value);
    }

    /// <summary>
    /// Gets or sets the double test.
    /// </summary>
    /// <value>
    /// The double test.
    /// </value>
    public double DoubleTest
    {
        get => GetOrCreate(23.8d); set => SetOrCreate(value);
    }

    /// <summary>
    /// Gets or sets the enum test.
    /// </summary>
    /// <value>
    /// The enum test.
    /// </value>
    public EnumTestValue EnumTest
    {
        get => GetOrCreate(EnumTestValue.Option1); set => SetOrCreate(value);
    }
}

OPTIONAL: Override Settings Cache Path

AppInfo.OverrideSettingsCachePath(path);

Create an instance or get existing Settings SettingsCache

Install ReactiveMarbles.CacheDatabase.Settings Nuget NuGet

var viewSettings = await AppInfo.SetupSettingsStore<ViewSettings>();

To Create an instance or get existing EncryptedSettings SettingsCache

Install ReactiveMarbles.CacheDatabase.EncryptedSettings Nuget NuGet

var viewSettings = await AppInfo.SetupSettingsStore<ViewSettings>("SECURE_PASSWORD");

To Delete the instance of the SettingsCache

await AppInfo.DeleteSettingsStore<ViewSettings>();

To Close the SettingsCache upon application exit

await AppInfo.DisposeSettingsStore<ViewSettings>();

Multiple SettingsCache's can be created, each SettingsCache will have a SettingsCache database created with the name of the SettingsCache class.

Downloads by Version

Similar & Alternative Packages

Hand-picked matching NuGet libraries based on tags & ecosystem

Depended On By

Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.