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

It seems like we have 3 proposals.

1) One extreme: the simplest solution for the use cases we've seen.

```webidl
partial interface IDBFactory {
  IDBRequest getDatabaseNames();
}
```

The IDBRequest result here is a list of names (`sequence<DOMString>` or `DOMStringList`, I'm assuming?).

2) The other extreme: full database objects.

```webidl
partial interface IDBFactory {
  IDBRequest getDatabases();
}
```

The IDBRequest result here is a `sequence<IDBDatabase>` (whose connection is considered to be closed?)

3) A middle ground: dictionaries with metadata. Would currently have the name, or the name + database version.

```webidl
partial interface IDBFactory {
  IDBRequest getDatabaseInfo();
}
```

The IDBRequest result here is a `sequence<IDBDatabaseInfo>`, where:

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

For the third alternative, given that the use cases we've seen only need names, we have the option to start out with a dictionary whose only attribute is `name`, and extend the dictionary later.

The first alternative seems to give more flexibility for implementations. For example, using my proposed weak guarantees, an implementation would be free to block on `upgradeneeded`, to return a list that doesn't include the database being upgraded, or to return a list that does return the database being upgraded. The other 2 versions would definitely need to block on `upgradeneeded`.

@aliams If I understand correctly, you prefer the 2nd alternative. What are your thoughts on the 3rd?

@beidson You mentioned you'd be willing to implement the first alternative. What are your thoughts on the newer alternatives? Would they add a significant amount of burden to the implementation work?

@bevis-tseng Do you prefer the 2nd or 3rd alternative?

I'll find time soon to prototype the alternatives and estimate the amount of work, but I'm willing to implement whichever version we agree on. Thank you very much for your thoughts!

-- 
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-323031994

Received on Thursday, 17 August 2017 10:42:49 UTC