Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zyrouge/dart_perks
📦 Perks is a simple-to-use persistent data storage.
https://github.com/zyrouge/dart_perks
dart database flutter json key-value no-sql
Last synced: 4 days ago
JSON representation
📦 Perks is a simple-to-use persistent data storage.
- Host: GitHub
- URL: https://github.com/zyrouge/dart_perks
- Owner: zyrouge
- License: mit
- Created: 2022-07-17T08:48:48.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-17T09:25:15.000Z (over 2 years ago)
- Last Synced: 2024-10-30T12:14:42.618Z (about 2 months ago)
- Topics: dart, database, flutter, json, key-value, no-sql
- Language: Dart
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Perks
📦 Perks is a simple-to-use persistent data storage.
[![pub package](https://img.shields.io/pub/v/perks.svg)](https://pub.dev/packages/perks)
[![License](https://img.shields.io/github/license/zyrouge/dart_perks)](./LICENSE)
[![Tests](https://github.com/zyrouge/dart_perks/actions/workflows/test.yml/badge.svg)](https://github.com/zyrouge/dart_perks/actions/workflows/test.yml)## Links
- [GitHub](https://github.com/zyrouge/dart_perks)
- [Pub.dev](https://pub.dev/packages/perks)
- [Documentation](https://pub.dev/documentation/perks/latest/)## Usage
- Adapters take care of read and write operations.
- Boxes abstract adapters to provide a way to perform operations on the data.### Available Adapters
- `PerksFileAdapter` - Asynchronous file based storage.
- `PerksFileSyncAdapter` - Synchronous file based storage.
- `PerksMemoryAdapter` - Synchronous memory based storage.### Available Boxes
- `PerksNameValueBox` - Asynchronous Name-Value (or Key-Value) paired database schema.
- `PerksNameValueSyncBox` - Synchronous Name-Value (or Key-Value) paired database schema.
- `PerksStringBox` - Asynchronous storage where data is stored as a single string.
- `PerksStringSyncBox` - Synchronous storage where data is stored as a single string.### Example
```dart
import 'package:perks/perks.dart';final PerksNameValueBox database = PerksNameValueBox(
adapter: PerksFileAdapter('data.db'),
);await database.set('hello', 'world');
print('Value of hello: ${await database.get('hello')}');
```Check out [example](./example) and [test](./test) for more examples.
# License
[MIT](./LICENSE)