HTML and CSS Reference
In-Depth Information
ous version works with or without web workers; no browser at this time supports the syn-
chronous version.
Table B.21. IDBFactory interface
Attribute/method
Description
Requests a connection to a database with given name and version number. If no database
with name exists, create a database with given name and version number.
open(name, [version])
deleteDatabase(name)
Requests deletion of a database with given name.
Compares two keys to determine equality and ordering for IndexedDB operations, such as
ordering. Returns a -1, if first key is less than second key; 0, if first key is equal to second
key; 1, if first key is greater than second key.
cmp(first, second)
Table B.22 lists the attributes and methods of the IDBCursor object. The cursor iterates
over object stores and indexes within an indexed database.
Table B.22. IDBCursor interface
Attribute/method
Description
source
On getting, returns the IDBOjectStore or IDBIndex that the cursor is iterating over.
direction
On getting, returns the cursor's current direction of traversal.
On getting, returns the key for the record at the cursor's position. If the cursor is outside
its range, this is undefined.
key
On getting, returns the cursor's current effective key. If the cursor is currently being iter-
ated or has iterated outside its range, returns undefined.
primaryKey
Returns an IDBRequest object. In a separate thread, uses value to update the value at the
current position of the cursor in the object store. If the cursor points to a record that has
just been deleted, a new record is created with the given value.
update(value)
Continues along the cursor's current direction of movement, and finds the next item with
a key matching the optional key parameter. If no key is specified, goes to the immediate
next position, based on the cursor's current direction of movement.
continue(key)
Returns an IDBRequest object. In a separate thread, deletes the record at the cursor's pos-
ition without moving the cursor. Afterward, the cursor's value is set to null.
delete()
Table B.23 lists the methods and attributes of the IDBDatabase object. The IDBData-
base serves primarily as a container for indexes and object stores. The IDBDatabase
object is the only way to get a transaction on the database.
 
 
Search WWH ::




Custom Search