Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/reactivemarbles/cachedatabase

A reimplementation of Akavache using the SQLite framework by Frank Krueger.
https://github.com/reactivemarbles/cachedatabase

sqlite sqlite3

Last synced: 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        

![License](https://img.shields.io/github/license/ReactiveMarbles/CacheDatabase.svg) [![Build](https://github.com/reactivemarbles/CacheDatabase/actions/workflows/ci-build.yml/badge.svg)](https://github.com/reactivemarbles/CacheDatabase/actions/workflows/ci-build.yml)

# CacheDatabase

A reimplementation of [Akavache](https://github.com/reactiveui/akavache) using the SQLite framework by [Frank Krueger](https://github.com/praeclarum/sqlite-net).

ReactiveMarbles.CacheDatabase.EncryptedSqlite3
![Nuget](https://img.shields.io/nuget/dt/ReactiveMarbles.CacheDatabase.EncryptedSqlite3?color=pink&style=plastic) [![NuGet](https://img.shields.io/nuget/v/ReactiveMarbles.CacheDatabase.EncryptedSqlite3.svg?style=plastic)](https://www.nuget.org/packages/ReactiveMarbles.CacheDatabase.EncryptedSqlite3)

ReactiveMarbles.CacheDatabase.Sqlite3
![Nuget](https://img.shields.io/nuget/dt/ReactiveMarbles.CacheDatabase.Sqlite3?color=pink&style=plastic) [![NuGet](https://img.shields.io/nuget/v/ReactiveMarbles.CacheDatabase.Sqlite3.svg?style=plastic)](https://www.nuget.org/packages/ReactiveMarbles.CacheDatabase.Sqlite3)

# 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
```c#
public class ViewSettings : SettingsBase
{
///
/// Initializes a new instance of the class.
///
public ViewSettings()
: base(nameof(ViewSettings))
{
}

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

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

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

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

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

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

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

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

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

## OPTIONAL: Override Settings Cache Path

```c#
AppInfo.OverrideSettingsCachePath(path);
```

## Create an instance or get existing Settings SettingsCache

Install ReactiveMarbles.CacheDatabase.Settings
![Nuget](https://img.shields.io/nuget/dt/ReactiveMarbles.CacheDatabase.Settings?color=pink&style=plastic) [![NuGet](https://img.shields.io/nuget/v/ReactiveMarbles.CacheDatabase.Settings.svg?style=plastic)](https://www.nuget.org/packages/ReactiveMarbles.CacheDatabase.Settings)

```c#
var viewSettings = await AppInfo.SetupSettingsStore();
```
## To Create an instance or get existing EncryptedSettings SettingsCache

Install ReactiveMarbles.CacheDatabase.EncryptedSettings
![Nuget](https://img.shields.io/nuget/dt/ReactiveMarbles.CacheDatabase.EncryptedSettings?color=pink&style=plastic) [![NuGet](https://img.shields.io/nuget/v/ReactiveMarbles.CacheDatabase.EncryptedSettings.svg?style=plastic)](https://www.nuget.org/packages/ReactiveMarbles.CacheDatabase.EncryptedSettings)
```c#
var viewSettings = await AppInfo.SetupSettingsStore("SECURE_PASSWORD");
```
## To Delete the instance of the SettingsCache
```c#
await AppInfo.DeleteSettingsStore();
```
## To Close the SettingsCache upon application exit
```c#
await AppInfo.DisposeSettingsStore();
```

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