ResourceDao class

Constructors

ResourceDao({DatabaseMode databaseMode = mode.DatabaseMode.PERSISTENCE_DB, bool isForTesting = false})

Properties

databaseMode DatabaseMode
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

delete(String? password, Resource? resource, Dstu2ResourceType? resourceType, Id? id, String? field, String? value) Future<int>
Delete specific resource
deleteAllResources(String? password) Future
Deletes all resources, including historical versions
deleteSingleType(String? password, {Dstu2ResourceType? resourceType, Resource? resource}) Future
pass in a resourceType or a resource, and db will delete all resources of that type - Note: will NOT delete any _historical stores (must pass in _history as the type for this to happen)
find(String? password, {Resource? resource, Dstu2ResourceType? resourceType, Id? id, String? field, String? value}) Future<List<Resource>>
searches for a specific Resource. That resource can be defined by passing a full Resource object, you may pass a resourceType and id or you can pass a search field - which can be nested, and the value you're looking for in that field From the sembast documentation: https://github.com/tekartik/sembast.dart/blob/master/sembast/doc/queries.md Assuming you have the following record: { "resourceType": "Immunization", "patient": { "reference": "Patient/12345" } } You can search for the nested value using a Finder Finder(filter: Filter.equals('patient.reference', 'Patient/12345'));
getAll(String? password) Future<List<Resource>>
returns all resources in the db, including historical versions
getResourceType(String? password, {List<Dstu2ResourceType>? resourceTypes, List<String>? resourceTypeStrings, Resource? resource}) Future<List<Resource>>
returns all resources of a specific type
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save(String? password, Resource? resource) Future<Resource>
Saves a Resource to the local Db, password is optional (but after set, it must always be used everytime), will update the meta fields of the Resource and adds an id if none is already given.
toString() String
A string representation of this object.
inherited
updatePw(String? oldPw, String? newPw) Future
update database password

Operators

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