Re: [w3c/IndexedDB] API to enumerate databases (#31)

Updated proposal, based on the comments above:

```webidl
partial interface IDBFactory {
  Promise<IDBDatabase> getAllDatabases();
}
```

Updated alternative:

```webidl
partial interface IDBFactory {
  Promise<IDBDatabaseInfo> getDatabasesInfo();
}

dictionary IDBDatabaseInfo {
  DOMString name;
  unsigned long long version;
}
```

The alternative has the advantage of not introducing a new dictionary, but the disadvantage that more data needs to be read and potentially shuttled across an IPC boundary.

If I understand correctly, the last comment from @bevis-tseng is in favor of Promise over IDBRequest, and in favor of exposing as little metadata as necessary. Based on the last comments from @beidson and @bevis-tseng, it seems like exposing the version number would be easy for both Firefox and Safari, so I added it to `IDBDatabaseInfo`. I haven't seen any comment advocating for returning a list of names (vs objects that we can later extend), so I removed that proposal.

I have a slight preference towards `getDatabasesInfo` (though I don't like the name very much), because I think the current use cases can make do with what's in `DatabaseInfo`. Also, `DatabaseInfo` is a strict subset of `IDBDatabase`, so we can later choose to make `IDBDatabaseInfo` a synonym for `IDBDatabase` without breaking apps that use the `IDBDatbaseInfo` interface. That being said, I'm perfectly fine with implementing the alternative.

@aliams @beidson @bevis-tseng Do you still prefer `getAllDatabases` over `getDatabasesInfo` (with a better name, if you have one), given the use cases outlined above? Any other thoughts on the new proposal?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/31#issuecomment-324125650

Received on Tuesday, 22 August 2017 19:20:33 UTC