littlefish_data_sembast 1.1.0
littlefish_data_sembast: ^1.1.0 copied to clipboard
The implementation of the sembast NoSQL database engine for littlefish mobile applications.
littlefish data sembast #
The sembast NoSQL database implementation for littlefish mobile applications. This package provides a local persistent database solution using the sembast package, implementing the DatabaseClient abstraction from littlefish_core.
Features #
- Local NoSQL document-based database
- Implements
DatabaseClient<Database>from littlefish_core - Support for collections (stores)
- CRUD operations with key-value storage
- Query support with predicates
- Database statistics tracking
- Cross-platform support (iOS, Android, macOS, Windows, Linux)
Usage #
import 'package:littlefish_data_sembast/littlefish_data_sembast.dart';
// Create settings
final settings = SembastDatabaseSettings(
enabled: true,
databaseName: 'my_app.db',
);
// Create and initialize the client
final client = SembastDatabaseClient(settings);
await client.connect();
// Register a collection
client.registerCollection<Map<String, dynamic>>('users');
// Store data
await client.put('users', 'user_1', {'name': 'John', 'email': 'john@example.com'});
// Retrieve data
final user = await client.get<Map<String, dynamic>>('users', 'user_1');
// Query data
final users = await client.getAll<Map<String, dynamic>>('users');
// Clean up
await client.dispose();