Intent to Ship: IndexedDB database info enumeration function

57 views
Skip to first unread message

Andreas Butler

unread,
Nov 1, 2018, 4:50:22 PM11/1/18
to blin...@chromium.org

Contact emails

chrome-ow...@chromium.org, andrea...@google.com, dmu...@chromium.org


Explainer

https://andreas-butler.github.io/idb-databases/EXPLAINER


Spec

https://pr-preview.s3.amazonaws.com/w3c/IndexedDB/pull/240.html#dom-idbfactory-databases


Summary

This change adds a database enumeration function to the Chromium implementation of the IndexedDB API to allow access to a list of current IndexedDB databases accessible by the current origin.


Link to “Intent to Implement” blink-dev discussion

https://groups.google.com/a/chromium.org/d/msg/blink-dev/qKjn0tLMezI/TCix0GI0CgAJ


Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes.


Debuggability

DevTools already supports listing IndexedDB database names.


Risks:

Interoperability and Compatibility

Edge: positive signals

LGTM’d by edge PM: https://github.com/w3c/IndexedDB/pull/240

Firefox: positive signals

https://github.com/w3c/IndexedDB/issues/31#issuecomment-323635338  

Safari: Positive signals

https://github.com/w3c/IndexedDB/issues/31#issuecomment-324791267

Web developers: Positive signals

https://github.com/w3c/IndexedDB/issues/31#issuecomment-324756055 ,  

https://github.com/w3c/IndexedDB/issues/31#issuecomment-323882274 ,

https://github.com/w3c/IndexedDB/issues/31#issuecomment-339070628 ,

https://stackoverflow.com/questions/15234363/indexeddb-view-all-databases-and-object-stores  

Ergonomics

The database enumeration function will return a Promise of a Sequence of IDBDatabaseInfo objects. The IDBDatabaseInfo objects will essentially be dictionaries of informational fields relevant to the IndexedDB databases accessible by the frame.


Returning the database information as a list wrapped in a Promise was chosen over returning an IDBRequest object, contrary to what has previously been the pattern with IndexedDB functions because web development is moving in the direction of Promise-based asynchronous behaviour. As developers will not have been previously exposed to this standardized database enumeration function it is not expected that breaking the established pattern will cause serious issues. Additionally, keeping the IDBRequest object restricted to interactions with uniquely specified databases (eg: requests for opening / closing particular database instances ) was determined to be a cleaner design choice.


Activation

As this feature is fairly intuitive and simple (single function addition to existing API), it is not expected that it will be difficult for developers to take advantage of it immediately.


Is this feature fully tested by web-platform-tests? Link to test suite results from wpt.fyi.

https://wpt.fyi/results/IndexedDB/get-databases.any.html?label=experimental

https://wpt.fyi/results/IndexedDB/get-databases.any.worker.html?label=experimental


Entry on the feature dashboard

https://www.chromestatus.com/features/6084476278931456



Victor Costan

unread,
Nov 1, 2018, 5:17:41 PM11/1/18
to andrea...@chromium.org, blin...@chromium.org
On Thu, Nov 1, 2018 at 1:50 PM Andreas Butler <andrea...@chromium.org> wrote:


Sorry for the inconvenience!
    Victor
 
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CA%2B9KpLPrR3bV3cpq7dVG8WEe2wap07kAZhvUeX4%3D4Rpx9Aasqw%40mail.gmail.com.

Philip Jägenstedt

unread,
Nov 2, 2018, 5:00:15 AM11/2/18
to Victor Costan, andrea...@chromium.org, blin...@chromium.org
LGTM1

The spec link had me thinking this isn't merged yet, but https://github.com/w3c/IndexedDB/pull/240 is merged.

Also very cool to see the tests passing on wpt.fyi before the flag is flipped :)

Daniel Bratell

unread,
Nov 2, 2018, 11:44:47 AM11/2/18
to Victor Costan, Philip Jägenstedt, andrea...@chromium.org, blin...@chromium.org
LGTM2

(the spec/pull link in the explainer is broken in case you care to keep that document for the future)

/Daniel
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAARdPYfRtr8GvVc%3D-J9X5T9%2B5ya1mcydYqeEQxHqjTK%2BL3t%2Bxg%40mail.gmail.com.



--
/* Opera Software, Linköping, Sweden: CET (UTC+1) */

Yoav Weiss

unread,
Nov 4, 2018, 11:42:35 AM11/4/18
to Daniel Bratell, Victor Costan, Philip Jägenstedt, andrea...@chromium.org, blin...@chromium.org
Reply all
Reply to author
Forward
0 new messages