public class JsIDBFactory extends JsElementalMixinBase implements IDBFactory
SVG_ZOOMANDPAN_DISABLE, SVG_ZOOMANDPAN_MAGNIFY, SVG_ZOOMANDPAN_UNKNOWN
Modifier | Constructor and Description |
---|---|
protected |
JsIDBFactory() |
Modifier and Type | Method and Description |
---|---|
short |
cmp(Object first,
Object second)
Compares two values as keys to determine equality and ordering for IndexedDB operations, such as storing and iterating.
|
JsIDBVersionChangeRequest |
deleteDatabase(String name)
Request deleting a database.
|
JsIDBRequest |
getDatabaseNames() |
JsIDBRequest |
open(String name)
Warning: The description documents the old specification.
|
addEventListener, addEventListener, beginElement, beginElementAt, dispatchEvent, endElement, endElementAt, getAnimatedClassName, getAnimatedHeight, getAnimatedHref, getAnimatedResult, getAnimatedTransform, getAnimatedWidth, getAnimatedX, getAnimatedY, getBBox, getChildElementCount, getCTM, getExternalResourcesRequired, getFarthestViewportElement, getFirstElementChild, getLastElementChild, getNearestViewportElement, getNextElementSibling, getPresentationAttribute, getPreserveAspectRatio, getPreviousElementSibling, getRequiredExtensions, getRequiredFeatures, getScreenCTM, getSvgStyle, getSystemLanguage, getTransformToElement, getViewBox, getXmllang, getXmlspace, getZoomAndPan, hasExtension, querySelector, querySelectorAll, removeEventListener, removeEventListener, setXmllang, setXmlspace, setZoomAndPan
at, at, intAt, intAt, length, numberAt, numberAt, setAt, setAt, setAt, setAt, setAt, setAt
cast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
intAt, length
numberAt
public final short cmp(Object first, Object second)
IDBFactory
Compares two values as keys to determine equality and ordering for IndexedDB operations, such as storing and iterating. Do not use this method for comparing arbitrary JavaScript values, because many JavaScript values are either not valid IndexedDB keys (booleans and objects, for example) or are treated as equivalent IndexedDB keys (for example, since IndexedDB ignores arrays with non-numeric properties and treats them as empty arrays, so any non-numeric array are treated as equivalent).
This throws an exception if either of the values is not a valid key.
Returned value | Description |
---|---|
-1 | 1st key < 2nd |
0 | 1st key = 2nd |
1 | 1st key > 2nd |
This method can raise an IDBDatabaseException with the following code:
Attribute | Description |
---|---|
NON_TRANSIENT_ERR | One of the supplied keys was not a valid key. |
cmp
in interface IDBFactory
public final JsIDBVersionChangeRequest deleteDatabase(String name)
IDBFactory
Request deleting a database. The method returns an IDBRequest object immediately, and performs the deletion operation asynchronously.
The deletion operation (performed in a different thread) consists of the following steps:
version
set to null
.blocked
event at the request object returned by the deleteDatabase
method, using IDBVersionChangeEvent with version
set to null
.If the database is successfully deleted, then an IDBSuccessEvent is fired on the request object returned from this method, with its result
set to null
.
If an error occurs while the database is being deleted, then an error event is fired on the request object that is returned from this method, with its code
and message
set to appropriate values.
Tip: If the browser you are using hasn't implemented this yet, you can delete the object stores one by one, thus effectively removing the database.
IDBRequest
IDBOpenRequest
.deleteDatabase
in interface IDBFactory
public final JsIDBRequest getDatabaseNames()
getDatabaseNames
in interface IDBFactory
public final JsIDBRequest open(String name)
IDBFactory
Request opening a connection to a database. The method returns an IDBRequest object immediately, and performs the opening operation asynchronously.
The opening operation—which is performed in a separate thread—consists of the following steps:
myAwesomeDatabase
already exists: VERSION_CHANGE
transactions have finished.If the operation is successful, an IDBSuccessEvent is fired on the request object that is returned from this method, with its result attribute set to the new IDBDatabase object for the connection.
If an error occurs while the database connection is being opened, then an error event is fired on the request object returned from this method, with its code
and message
set to appropriate values.
IDBRequest
IDBOpenRequest
.open
in interface IDBFactory
Copyright © 2018. All rights reserved.