/*
* Copyright (C)2005-2013 Haxe Foundation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
// This file is generated, do not edit!
package js.html.idb;
/** The IDBObjectStore
interface of the IndexedDB API represents an object store in a database. Records within an object store are sorted according to their keys. This sorting enable fast insertion, look-up, and ordered retrieval.
Documentation for this class was provided by MDN. */
@:native("IDBObjectStore")
extern class ObjectStore
{
var autoIncrement(default,null) : Bool;
/** A list of the names of indexes on objects in this object store. */
var indexNames(default,null) : js.html.DOMStringList;
/** The key path of this object store. If this attribute is null, the application must provide a key for each modification operation. */
var keyPath(default,null) : Any;
/** The name of this object store. */
var name(default,null) : String;
var transaction(default,null) : Transaction;
function add( value : Dynamic, ?key : Key ) : Request;
function clear() : Request;
/**
Immediately returns an IDBRequest object and asynchronously count the amount of objects in the object store that match the parameter, a key or a key range. If the parameter is not valid returns an exception.
This method can raise an IDBDatabaseException with the following codes:
DATA_ERR
NOT_ALLOWED_ERR
Creates and returns a new index in the connected database. Note that this method must be called only from a VERSION_CHANGE
transaction callback.
IDBIndex createIndex ( in DOMString name, in DOMString keyPath, in Object optionalParameters ) raises (IDBDatabaseException);
IDBIndexParameters
, which is not yet recognized by any browserOptions object whose attributes are optional parameters to the method. It includes the following properties:
Attribute | Description |
---|---|
unique | If true, the index will not allow duplicate values for a single key. |
multientry | If true, the index will add an entry in the index for each array element when the keypath resolves to an Array. If false, it will add one single entry containing the Array. |
Unknown parameters are ignored.
This method can raise an IDBDatabaseException with the following codes:
CONSTRAINT_ERR
NOT_ALLOWED_ERR
VERSION_CHANGE
transaction callback.Immediately returns an IDBRequest
object, and removes the record specified by the given key from this object store, and any indexes that reference it, in a separate thread. If no record exists in this object store corresponding to the key, an error event is fired on the returned request object, with its code
set to NOT_FOUND_ERR
and an appropriate message
. If the record is successfully removed, then a success event is fired on the returned request object, using the IDBTransactionEvent
interface, with the result
set to undefined
, and transaction set to the transaction in which this object store is opened.
IDBRequest delete ( in any key ) raises (IDBDatabaseException);
This method can raise an IDBDatabaseException with the following codes:
Immediately returns an IDBRequest object, and retrieves the requested record from the object store in a separate thread. If the operation is successful, then a success event is fired on the returned object, using the IDBTransactionEvent interface, with its result
set to the retrieved value, and transaction
set to the transaction in which this object store is opened. If a record does not exist in the object store for the key parameter, then an error event is fired on the returned object, with its code
set to NOT_FOUND_ERR
and an appropriate message
.
IDBRequest
This method can raise an IDBDatabaseException with the following code:
DATA_ERR
key
parameter was not a valid value.TRANSACTION_INACTIVE_ERR
Immediately returns an IDBRequest object, and creates a cursor over the records in this object store, in a separate thread. If there is even a single record that matches the key range, then a success event is fired on the returned object, with its result
set to the IDBCursor object for the new cursor. If no records match the key range, then a success event is fired on the returned object, with its result
set to null.
IDBRequest openCursor ( in optional IDBKeyRange range, in optional unsigned short direction ) raises (IDBDatabaseException);
IDBRequest
This method can raise an IDBDatabaseException with the following code:
NOT_ALLOWED_ERR