/* * 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 IDBDatabase
interface of the IndexedDB API provides asynchronous access to a connection to a database. Use it to create, manipulate, and delete objects in that database. The interface also provides the only way to get a transaction and manage versions on that database.
Inherits from: EventTarget
Immediately returns an IDBTransaction object, and starts a transaction in a separate thread. The method returns a transaction object (IDBTransaction
) containing the objectStore() method, which you can use to access your object store.
READ_ONLY
, READ_WRITE
, and VERSION_CHANGE
. If you don't provide the parameter, the default access mode is READ_ONLY
. To avoid slowing things down, don't open a READ_WRITE
transaction, unless you actually need to write into the database.To start a transaction with the following scope, you can use the code snippets in the table. As noted earlier:
IDBTransaction.READ_ONLY
, use webkitIDBTransaction.READ_ONLY
).READ_ONLY
, so you don't really have to specify it. Of course, if you need to write into the object store, you can open the transaction in the READ_WRITE
mode.Scope | Code |
---|---|
Single object store |
Alternatively:
|
Multiple object stores | var transaction = db.transaction(['my-store-name', 'my-store-name2'], IDBTransaction.READ_ONLY); |
All object stores |
You cannot pass an empty array into the storeNames parameter, such as in the following: Warning: Accessing all obejct stores under the READ_WRITE mode means that you can run only that transaction. You cannot have writing transactions with overlapping scopes. |
IDBTransaction
This method can raise an IDBDatabaseException with the following codes:
Exception | Description |
---|---|
NOT_ALLOWED_ERR | The error is thrown for one of two reasons:
|
NOT_FOUND_ERR | One of the object stores doesn't exist in the connected database. |