SpecificDatabase class
Wraps a DatabaseRepository with all of the databaseFunctions having a given databaseName automatically passed as the database argument.
Constructors
- SpecificDatabase(DatabaseRepository database, String databaseName)
- database has all of the underlying database implementation for all of the database functions of this object.
Properties
- database → DatabaseRepository
-
The underlying database implementation for all of the functions of this
object.
final
- databaseName → String
-
The value passed as the database in all of the database functions of this
object.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
containsRows<
T extends BaseModel> (T supplier()) → FutureOr< bool> -
Returns true if the table/container in databaseName contains any data with same type provided by
supplier
-
deleteModel<
T extends BaseModel> (T model) → FutureOr< bool> -
Deletes the
T
model
in databaseName.model
doesn not need to be exactly the same, just have the same id. -
findAllModelsOfType<
T extends BaseModel> (T supplier()) → FutureOr< Iterable< T> > -
This functions finds all models of the given type that have their
BaseModel.id start with the prefix given by the
supplier
s BaseModelIDExtension.prefixTypeForId -
findModel<
T extends BaseModel> (String key) → FutureOr< T?> -
Finds the
T
model in databaseName with id ofkey
. -
findModels<
T extends BaseModel> (Iterable< String> keys) → FutureOr<Iterable< T> > -
Finds all the models in databaseName that have the given
keys
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
saveModel<
T extends BaseModel> (T model) → FutureOr< T> -
Saves the
T
model
in databaseName.model
s that do not have an existing id will have one automatically assigned to them. This function doesn't care if there is an already existing model or not. Existing models will just be overridden -
saveModels<
T extends BaseModel> (Iterable< T> models) → FutureOr<void> -
Saves the
T
models
in databaseName.models
that do not have an existing id will have one automatically assigned to them. This function doesn't care if there is an already existing model or not. Existing models will just be overridden -
searchByModelAndFields<
T extends BaseModel> (T supplier(), T model, List< String> fields) → FutureOr<Iterable< T> > -
Finds all models in databaseName that have values that match the passed
model
's values -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited