Database
The IDBDatabase interface of the IndexedDB API provides a connection to a database; you can use an IDBDatabase 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.
Documentation IDBDatabase by Mozilla Contributors, licensed under CC-BY-SA 2.5.
Instance Members
name: StringA DOMString that contains the name of the connected database.
version: IntA 64-bit integer that contains the version of the connected database. When a database is first created, this attribute is an empty string.
objectStoreNames: js.html.DOMStringListA DOMStringList that contains a list of the names of the object stores currently in the connected database.
onabort: haxe.FunctionFires when access of the database is aborted.
onclose: haxe.FunctionFires when the close event occurs; this happens when the database is unexpectedly closed, such as during application shutdown.
onerror: haxe.FunctionFires when access to the database fails.
onversionchange: haxe.FunctionFires when a database structure change (IDBOpenDBRequest.onupgradeneeded event or ``IDBFactory.deleteDatabase() was requested elsewhere (most probably in another window/tab on the same computer). This is different from the version change transaction (see IDBVersionChangeEvent), but it is related.
createObjectStore(name: String, ?optionalParameters: Null<ObjectStoreParameters>): ObjectStoreCreates and returns a new object store or index.
| Name | Type | Default |
|---|---|---|
name |
String | |
optionalParameters |
Null<ObjectStoreParameters> | (optional) |
| Returns |
|---|
| ObjectStore |
Destroys the object store with the given name in the connected database, along with any indexes that reference it.
| Name | Type |
|---|---|
name |
String |
transaction(storeNames: String, ?mode: TransactionMode = READONLY): TransactionImmediately returns a transaction object (IDBTransaction) containing the IDBTransaction.objectStore method, which you can use to access your object store. Runs in a separate thread.
| Name | Type | Default |
|---|---|---|
storeNames |
String | |
mode |
TransactionMode | READONLY |
| Returns |
|---|
| Transaction |
close(): VoidReturns immediately and closes the connection to a database in a separate thread.
| Name | Type | Default |
|---|---|---|
name |
String | |
type |
String | (optional) |
| Returns |
|---|
| Request |