Database class Null safety

provides a connection to a database; you can use an Database object to open a transaction on your database then create, manipulate, and delete objects (data) in that database. The interface provides the only way to get and manage versions of the database.

Constructors

Database(IdbFactory _factory)
ctor

Properties

factory IdbFactory
factory for this type of database
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
name String
name of the connected database.
read-only
objectStoreNames Iterable<String>
list of the names of the object stores currently in the connected database
read-only
onVersionChange Stream<VersionChangeEvent>
listen for onVersionChange event [...]
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
version int
A 64-bit integer that contains the version of the connected database. [...]
read-only

Methods

close() → void
returns immediately and closes the connection in a separate thread. [...]
createObjectStore(String name, {String? keyPath, bool? autoIncrement}) ObjectStore
creates and returns a new object store or index. [...]
deleteObjectStore(String name) → void
destroys the object store with the given name in the connected database, along with any indexes that reference it. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited
transaction(dynamic storeNameOrStoreNames, String mode) Transaction
returns a transaction object (Transaction) containing the Transaction.objectStore method, which you can use to access your object store. [...]
transactionList(List<String> storeNames, String mode) Transaction
helper for transaction on list of object stores

Operators

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