ObjectStore class abstract

represents an object store in a database. Records within an object store are sorted according to their keys. This sorting enables fast insertion, look-up, and ordered retrieval.

Constructors

ObjectStore()

Properties

autoIncrement bool
returns the value of the auto increment flag for this object store.
no setter
hashCode int
The hash code for this object.
no setterinherited
indexNames List<String>
returns a list of the names of indexes on objects in this object store.
no setter
keyPath Object?
Returns the key path of this object store.
no setter
name String
The name of this object store.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(Object value, [Object? key]) Future<Object>
Creates a structured clone of the value, and stores the cloned value in the object store. This is for adding new records to an object store.
clear() Future<void>
clears this object store in a separate thread. This is for deleting all the current data out of an object store.
count([Object? keyOrRange]) Future<int>
returns the total number of records that match the provided key or IDBKeyRange. If no arguments are provided, it returns the total number of records in the store.
createIndex(String name, Object keyPath, {bool? unique, bool? multiEntry}) Index
Creates and returns a new Index object in the connected database.
delete(Object keyOrRange) Future<void>
deletes the object store records by key or key range.
deleteIndex(String name) → void
Destroys the index with the specified name in the connected database, used during a version upgrade.
getAll([Object? query, int? count]) Future<List<Object>>
returns all objects in the object store matching the specified parameter or all objects in the store if no parameters are given.
getAllKeys([Object? query, int? count]) Future<List<Object>>
returns record keys for all objects in the object store matching the specified parameter or all objects in the store if no parameters are given.
getObject(Object key) Future<Object?>
returns the object selected by the specified key. This is for retrieving specific records from an object store.
index(String name) Index
opens a named index in the current object store, after which it can be used to, for example, return a series of records sorted by that index using a cursor.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openCursor({Object? key, KeyRange? range, String? direction, bool? autoAdvance}) Stream<CursorWithValue>
Used for iterating through an object store with a cursor.
openKeyCursor({Object? key, KeyRange? range, String? direction, bool? autoAdvance}) Stream<Cursor>
Used for iterating through an object store with a key cursor.
put(Object value, [Object? key]) Future<Object>
creates a structured clone of the value and stores the cloned value in the object store. This is for adding new records, or updating existing records in an object store when the transaction's mode is readwrite.
toString() String
A string representation of this object.
override

Operators

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