Home

# Class goog.db.IndexedDb

Creates an IDBDatabase wrapper object. The database object has methods for setting the version to change the structure of the database and for creating transactions to get or modify the stored records. Should not be created directly, call {@link goog.db.openDatabase} to set up the connection.

Instance Method Summary
| `close()` Closes the database connection. Metadata queries can still be made after this method is called, but otherwise this wrapper should not be used further.
| `createObjectStore(string name, ?Object= opt_params) ⇒ ?goog.db.ObjectStore` Creates an object store in this database. Can only be called inside the callback for the Deferred returned from #setVersion.
| `createTransaction(Array.<string>= opt_storeNames, ?goog.db.Transaction.TransactionMode= opt_mode) ⇒ !goog.db.Transaction` Creates a new transaction.
| `deleteObjectStore(string name)` Deletes an object store. Can only be called inside the callback for the Deferred returned from #setVersion.
| `getName() ⇒ string`
| `getObjectStoreNames() ⇒ ?Array`
| `getVersion() ⇒ string`
| `isOpen() ⇒ boolean`

`setVersion(string version) ⇒ !goog.async.Deferred`

Updates the version of the database and returns a Deferred transaction. The database's structure can be changed inside this Deferred's callback, but nowhere else. This means adding or deleting object stores, and adding or deleting indexes. The version change will not succeed unless there are no other connections active for this database anywhere. A new database connection should be opened after the version change is finished to pick up changes.