SchemaDB<T extends Schema> class

SchemaDB

Inheritance

Constructors

SchemaDB(dynamic storage, SchemaDBItemCreator<T> _creator, {dynamic version = 1, OnUpgrade? onUpgrade})

Properties

hashCode int
The hash code for this object.
no setterinherited
onUpgrade OnUpgrade<T>?
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
v int
finalinherited

Methods

cleanup() Future
trigger storage cleanup (f.e. condense storage file)
inherited
close() Future
close db
inherited
createItem(Map data) → T
convert dynamic map to concrete type T (opposite of itemToMap)
override
find([Map query = const {}, ListenerCallback? listener]) Future<List<T>>
get all documents that match query with optional change-listener
inherited
first([Map query = const {}]) Future<T>
get first document that matches query
inherited
insert(T doc) Future<ObjectId>
insert document
inherited
insertMany(List<T> docs) Future<List<ObjectId>>
insert many documents
inherited
itemToMap(T item) Map
convert concrete type T to dynamic map (opposite of createItem)
override
last([Map query = const {}]) Future<T>
get last document that matches query
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(dynamic query) Future<int>
remove documents that match query
inherited
toString() String
A string representation of this object.
inherited
update(Map query, Map changes, [bool replace = false]) Future<int>
update database, takes query, changes and an optional replace flag
inherited
wait() Future
returns future to await all previous db actions
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited