Draft
This page is not complete.
Important: The synchronous version of the IndexedDB API was originally intended for use only with Web Workers, and was eventually removed from the spec because its need was questionable. It may however be reintroduced in the future if there is enough demand from web developers.
The DatabaseSync interface in the IndexedDB API represents a synchronous connection to a database.
IDBObjectStoreSync createObjectStore (in DOMString |
IDBObjectStoreSync openObjectStore (in DOMString name, in optional unsigned short mode) raises (IDBDatabaseException); |
void removeObjectStore (in DOMString storeName) raises (IDBDatabaseException); |
void setVersion (in DOMString version); |
IDBTransactionSync transaction (in optional DOMStringList storeNames, in optional unsigned int timeout) raises (IDBDatabaseException); |
| Attribute | Type | Description |
|---|---|---|
description | readonly DOMString | The human-readable description of the connected database. |
name
| readonly DOMString | The name of the connected database. |
objectStores
| readonly DOMStringList | The names of the object stores that exist in the connected database. |
version
| readonly DOMString | The version of the connected database. Has the null value when the database is first created. |
Creates and returns a new object store with the given name in the connected database.
IDBObjectStoreSync createObjectStore( in DOMString name, in DOMString keypath, in optional boolean autoIncrement ) raises (IDBDatabaseException);
IDBObjectStoreSyncThis method can raise an IDBDatabaseException with the following code:
CONSTRAINT_ERROpens the object store with the given name in the connected database using the specified mode.
IDBObjectStoreSync openObjectStore ( in DOMString name, in optional unsigned short mode ) raises (IDBDatabaseException);
IDBObjectStoreSyncThis method can raise an IDBDatabaseException with the following code:
NOT_FOUND_ERRDestroys an object store with the given name, as well as all indexes that reference that object store.
void removeObjectStore ( in DOMString storeName ) raises (IDBDatabaseException);
void
This method can raise an IDBDatabaseException with the following code:
Sets the version of the connected database.
void setVersion ( in DOMString version );
void
Creates and returns a transaction, acquiring locks on the given database objects, within the specified timeout duration, if possible.
IDBTransactionSync transaction ( in optional DOMStringList storeNames, in optional unsigned int timeout ) raises (IDBDatabaseException);
storeNames.IDBTransactionSyncThis method can raise an IDBDatabaseException with the following code:
TIMEOUT_ERRstoreNames takes longer than the timeout interval.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabaseSync