entidb_flutter library
EntiDB Flutter Plugin
This package provides EntiDB database functionality for Flutter applications by bundling the native libraries for all supported platforms.
Usage
Add entidb_flutter to your pubspec.yaml:
dependencies:
entidb_flutter: ^2.0.0-alpha.1
Then import and use:
import 'package:entidb_flutter/entidb_flutter.dart';
void main() async {
// Open a database
final db = Database.open('/path/to/database');
// Or use in-memory
final memDb = Database.openMemory();
// Get a collection
final users = db.collection('users');
// Store data
final id = EntityId.generate();
db.put(users, id, Uint8List.fromList([1, 2, 3]));
// Retrieve data
final data = db.get(users, id);
// Use transactions
db.transaction((txn) {
txn.put(users, id, data);
});
// Always close when done
db.close();
}
Platform Support
| Platform | Support |
|---|---|
| Android | ✅ |
| iOS | ✅ |
| macOS | ✅ |
| Windows | ✅ |
| Linux | ✅ |
| Web | ❌ (use entidb_web) |
Documentation
For full API documentation, see the entidb_dart package.
Classes
- BackupInfo
- Information about a backup.
- BytesCodec
- A pass-through codec for raw bytes.
-
Codec<
T> -
A codec for encoding and decoding entities of type
T. - Collection
- Represents a named collection of entities.
- CryptoManager
- Encryption manager for EntiDB.
- Database
- The main entry point for interacting with EntiDB.
- DatabaseStats
- A snapshot of database statistics.
- EntityId
- A 16-byte unique entity identifier.
- EntityIterator
- An iterator over entities in a collection.
-
FunctionCodec<
T> - A simple codec that wraps encode/decode functions.
- RestoreStats
- Statistics from a restore operation.
- StringCodec
- A codec for UTF-8 strings.
- Transaction
- A database transaction for atomic operations.
-
TypedCollection<
T> - A type-safe wrapper around a collection.
Extensions
- EntityIteratorExtensions on EntityIterator
- Extension methods for EntityIterator to provide Iterable-like behavior.
- TypedCollectionExtension on Database
- Extension to create typed collections from Database.
Functions
-
setEntiDbLibraryPath(
String path) → void - Sets a custom library path for testing or development.
Exceptions / Errors
- EntiDbCorruptionError
- Error thrown when data corruption is detected.
- EntiDbError
- Base class for all EntiDB errors.
- EntiDbInvalidError
- Error thrown for invalid arguments or state.
- EntiDbIoError
- Error thrown for I/O failures.
- EntiDbNotFoundError
- Error thrown when an entity is not found.
- EntiDbNotSupportedError
- Error thrown when a feature is not supported.
- EntiDbTransactionError
- Error thrown for transaction failures.