Database class abstract
Database.
The database object and client for the store and record operations
Get it from DatabaseFactory.openDatabase, once, and keep it for the
lifetime of the app. Pass it as the first argument of the store and record
methods (store.add(db, value), store.record(key).get(db)). Inside
transaction, pass the transaction instead.
- Implemented types
- Available extensions
Constructors
- Database()
Properties
Methods
-
addAllStoresOnChangesListener(
TransactionRecordChangeListener onChanges, {List< String> ? excludedStoreNames, StoresTrackOnChangesStorePredicate? storePredicate}) → void -
Available on Database, provided by the SembastDatabaseAllStoresChangesListenerExtension extension
Listen for changes on all stores -
checkForChanges(
) → Future< void> -
Available on Database, provided by the DatabaseExtension extension
Behavior depends on the implementation. On sembast io, nothing will happen. On sembast_web and sembast_sqflite, data will be read again (incrementally or not) to handle external changes. -
close(
) → Future - Close the database
-
compact(
) → Future< void> -
Available on Database, provided by the DatabaseExtension extension
Compact the database. -
dropAll(
) → Future< void> -
Available on DatabaseClient, provided by the SembastDatabaseClientExtension extension
Clear all records in the database. Close all existing listeners. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reload(
) → Future< void> -
Available on Database, provided by the DatabaseExtension extension
Warning: unsafe. -
removeAllStoresOnChangesListener(
TransactionRecordChangeListener onChanges) → void -
Available on Database, provided by the SembastDatabaseAllStoresChangesListenerExtension extension
Remove a global change listener -
reOpen(
) → Future< void> -
Available on Database, provided by the DatabaseExtension extension
Warning: unsafe. -
toString(
) → String -
A string representation of this object.
inherited
-
transaction<
T> (FutureOr< T> action(Transaction transaction)) → Future<T> - execute the action in a transaction use the current if any
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited