From d3d312b4b52a0aa4017043c1a63cf747002349f6 Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Mon, 1 Feb 2021 13:44:29 -0800 Subject: [PATCH] Speculative getAllEntries() spec --- index.bs | 226 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 147 insertions(+), 79 deletions(-) diff --git a/index.bs b/index.bs index d93a954..e7bd007 100644 --- a/index.bs +++ b/index.bs @@ -2749,6 +2749,7 @@ interface IDBObjectStore { optional [EnforceRange] unsigned long count); [NewObject] IDBRequest getAllKeys(optional any query, optional [EnforceRange] unsigned long count); + [NewObject] IDBRequest getAllEntries(optional IDBGetAllEntriesOptions options = {}); [NewObject] IDBRequest count(optional any query); [NewObject] IDBRequest openCursor(optional any query, @@ -2768,6 +2769,12 @@ dictionary IDBIndexParameters { boolean unique = false; boolean multiEntry = false; }; + +dictionary IDBGetAllEntriesOptions { + any query = null; + [EnforceRange] unsigned long count; + IDBCursorDirection direction = "next"; +};
@@ -3120,6 +3127,14 @@ The clear() method steps are: If successful, |request|'s {{IDBRequest/result}} will be an [=Array=] of the [=/keys=]. + : |request| = |store| . {{IDBObjectStore/getAllEntries()|getAllEntries}}(|options|) + :: + Retrieves multiple [=/keys=] and [=/values=] of [=object-store/records=]. + + The |query| option specifies a [=/key=] or [=key range=] to match. The |count| option limits the number or records matched. Set the |direction| option to "{{IDBCursorDirection/next}}" to retrieve the first |count| records, or "{{IDBCursorDirection/prev}}" to return the last |count| records. + + If successful, |request|'s {{IDBRequest/result}} will be an [=Array=], with each member being an [=Array=] with a [=/key=] [=/value=] pair. + : |request| = |store| . {{IDBObjectStore/count()|count}}(|query|) :: @@ -3216,7 +3231,7 @@ The getAll(|query|, |count|) method steps a [=/converting a value to a key range=] with |query|. Rethrow any exceptions. -1. Let |operation| be an algorithm to run [=retrieve multiple values from an object store=] with the [=/current Realm=], |store|, |range|, and |count| if given. +1. Let |operation| be an algorithm to run [=retrieve multiple items from an object store=] with the [=/current Realm=], |store|, |range|, "value", and |count| if given. 1. Return the result (an {{IDBRequest}}) of running [=asynchronously execute a request=] with [=/this=] and |operation|. @@ -3225,7 +3240,7 @@ The getAll(|query|, |count|) method steps a