The IDBVersionChangeRequest.setVersion
method updates the version of the database, returning immediately and running a versionchange
transaction on the connected database in a separate thread.
For older WebKit browsers, call this method before creating or deleting an object store.
Warning: The latest draft of the specification has dropped this method. Some not up-to-date browsers still implement this method. The new way is to define the version in the IDBDatabase.open()
method and create and delete object stores in the onupgradeneeded
event handler associated with the returned request.
Syntax
IDBVersionChangeRequest
setVersion
([TreatNullAs=EmptyString] in DOMString
version
);
Example
TBD
Parameters
- version
- The version to store in the database.
Returns
IDBVersionChangeRequest
- The request to change the version of a database.
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
setVersion | Chrome No support No | Edge No support No | Firefox No support No | IE No support No | Opera No support No | Safari No support No | WebView Android No support No | Chrome Android No support No | Firefox Android No support No | Opera Android No support No | Safari iOS No support No | Samsung Internet Android No support No |
Legend
- No support
- No support
- Non-standard. Expect poor cross-browser support.
- Non-standard. Expect poor cross-browser support.
- Deprecated. Not for use in new websites.
- Deprecated. Not for use in new websites.