W3cubDocs

/Web APIs

IDBFactory: databases() method

The databases method of the IDBFactory interface returns a list representing all the available databases, including their names and versions.

Note: This feature is available in Web Workers

Note: This method is introduced in a draft of a specifications and browser compatibility is limited.

Syntax

js

databases()

Parameters

The method does not take in any parameters.

Return value

A promise that resolves either to an error or a list of dictionaries, each with two elements, name and version:

name

The database name.

version

The database version.

Exceptions

SecurityError DOMException

Thrown if the method is called from an opaque origin.

Examples

js

const promise = indexedDB.databases();
promise.then((databases) => {
  console.log(databases);
});

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
databases 72 79 No No 60 14 72 72 No 51 14 11.0

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/databases