Re: [w3c/IndexedDB] `getAll()` with both key and value (or index key and primary key) (#206)

> while "record" is a spec term, I don't think it has made it into the API yet so there isn't a consistency argument.

My main argument here is that the spec and MDN ([e.g.](https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex/getAll)) both consistently use the term "record". Other spec terms tend to map directly into the API symbol names. To do otherwise would make it harder to reference the spec or MDN as documentation. But you are correct that if only looking at API symbol names, "record" hasn't been used yet.

> Is there something that distinguishes an IDB "record" from the "entries" in [Object.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries) and [Map.entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries)?

Here are a few:

* **Conceptually**, records are immutable. You can only read them, delete them, or replace them.
* **Concretely**
  * IDB records cannot be accessed synchronously
  * so far we're planning to use a different format for the data returned by getAllRecords as compared to `Map.entries` or `Object.entries`.

An IDB record is still conceptually a key/value pair, but "record" I think more strongly evokes exactly what it is, i.e. a "row in a database", than does "entry". TBH, either term work, so it feels like a bit of a bike shed and it's probably not possible to make a wrong decision here, but what is the concrete advantage of using "entry"?

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

Message ID: <w3c/IndexedDB/issues/206/2456082983@github.com>

Received on Tuesday, 5 November 2024 02:16:18 UTC