Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/reactivemarbles/cachedatabase
- Owner: reactivemarbles
- License: mit
- Created: 2021-08-09T07:49:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-21T00:02:21.000Z (8 months ago)
- Last Synced: 2024-05-22T01:20:59.389Z (8 months ago)
- Topics: sqlite, sqlite3
- Language: C#
- Homepage:
- Size: 243 KB
- Stars: 9
- Watchers: 4
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 SettingsCacheInstall 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.