sembast_io library
sembast for the Dart VM and Flutter Android, iOS, macOS, Windows and Linux.
Exports the whole package:sembast/sembast.dart API and
databaseFactoryIo, which stores each database in a single file.
In a Flutter app, put the file in a folder from path_provider
(getApplicationSupportDirectory()). On the web, use
package:sembast_web/sembast_web.dart instead.
Classes
- AsyncContentCodecBase
-
Base class for a custion implementation, by defining only
decodeAsyncandencodeAsync - Boundary
- Sort order boundary, lower or upper to use in a Finder
- Database
- Database.
- DatabaseClient
- Database client (either Database or Transaction)
- DatabaseFactory
- The database factory that allow opening database
- DatabaseMode
- The modes in which a Database can be opened.
- Field
- Special field access
- FieldKey
- Field Key utilities
- FieldValue
- Update values
- Filter
- Filter for searching into the database
- Finder
- Finder helper for searching a given store
-
QueryRef<
K extends Key?, V extends Value?> - A query on a store.
-
RecordChange<
K, V> -
Record change info streamed during
StoreRef.onChange. -
RecordRef<
K extends Key?, V extends Value?> - An immutable record reference
-
RecordSnapshot<
K extends Key?, V extends Value?> - A read record
-
RecordsRef<
K extends Key?, V extends Value?> - An immutable reference to multiple records
- SembastCodec
- The sembast codec to use to read/write records.
-
SortOrder<
T extends Object?> - Sort order
-
StoreFactory<
K extends Key?, V extends Value?> - Store factory interface
-
StoreRef<
K extends Key?, V extends Value?> - A pointer to a store.
- Transaction
- Database transaction.
Extensions
- DatabaseExtension on Database
- Database extension methods.
-
RecordSnapshotIterableExtension
on Iterable<
RecordSnapshot< K, V> > - Extension on iterable of record snapshot
- SembastDatabaseAllStoresChangesListenerExtension on Database
- All stores changes listener extension.
- SembastDatabaseClientExtension on DatabaseClient
- Database client extension methods.
- SembastDatabaseFactorySandboxExtension on DatabaseFactory
- Database factory sandbox extension.
- SembastFilterCombination on Filter
- Provides convenience methods for combining multiple Filters.
-
SembastQueryRefCommonExtension
on QueryRef<
K, V> - Common extension
-
SembastQueryRefExtension
on QueryRef<
K, V> - Query db actions.
-
SembastQueryRefSyncExtension
on QueryRef<
K, V> - Query db actions. synchronous access.
-
SembastRecordChangeExtension
on RecordChange<
K, V> - Record change helper.
-
SembastRecordRefExtension
on RecordRef<
K, V> - Record ref sembast public extension.
-
SembastRecordRefSyncExtension
on RecordRef<
K, V> - Record ref sembast public extension.
-
SembastRecordsRefCommonExtension
on RecordsRef<
K, V> - Record ref common extension.
-
SembastRecordsRefExtension
on RecordsRef<
K, V> - Record ref sembast public extension.
-
SembastRecordsRefSyncExtension
on RecordsRef<
K, V> - Record ref sembast public extension.
-
SembastStoreRefCommonExtension
on StoreRef<
K, V> - Store ref common public sembast extension (no db access).
-
SembastStoreRefExtension
on StoreRef<
K, V> - Store ref public sembast extension.
-
SembastStoreRefSyncExtension
on StoreRef<
K, V> - Store ref public sembast extension.
Properties
- databaseFactoryIo → DatabaseFactory
-
Factory for io databases (flutter, dart vm).
no setter
- debugSembastWarnDatabaseCallInTransaction ↔ bool
-
Warning when using database object in transaction in debug mode
could become the default one day
getter/setter pair
-
intMapStoreFactory
→ StoreFactoryBase<
int, Map< String, Object?> > -
Store factory with key as int and value as Map
final
- sembastCodecDefault ↔ SembastCodec
-
Json Codec with supports for DateTime and Blobs (UInt8List)
getter/setter pair
-
sembastDefaultTypeAdapters
→ List<
SembastTypeAdapter< Object, String> > -
Support Timestamp and Blob
final
-
stringMapStoreFactory
→ StoreFactoryBase<
String, Map< String, Object?> > -
Store factory with key as String and value as Map
final
Functions
-
createDatabaseFactoryIo(
{String? rootPath}) → DatabaseFactory - Make sembast database all belong to a single rootPath instead of relative to the current directory or absolute in the whole file system
-
disableSembastCooperator(
) → void - Disable sembast cooperator.
-
enableSembastCooperator(
{int? delayMicroseconds, int? pauseMicroseconds}) → void - Re-enable sembast cooperator or change default pause and delay
-
sembastCodecWithAdapters(
Iterable< SembastTypeAdapter> adapters) → SembastCodec - Default codec has no toString converted and no signature. as format is expected to be compatible
Typedefs
- OnVersionChangedFunction = FutureOr Function(Database db, int oldVersion, int newVersion)
- Callback interface called when the existing version differs from the one expected.
- RecordKeyBase = Object
- Base key.
- RecordValueBase = Object
- Base value.
-
SembastTransactionFunction<
T> = FutureOr< T> Function(Transaction transaction) - Transaction function.
- StoresTrackOnChangesStorePredicate = bool Function(String store)
- Check whether a store should track changes by default store ending with _local are excluded
-
TransactionRecordChangeListener<
K, V> = FutureOr< void> Function(Transaction transaction, List<RecordChange< changes)K, V> > - Record change listener
Exceptions / Errors
- DatabaseException
- Database exception.