LibWeb/IDB: Implement IDBObjectStore::get_all_records

This commit is contained in:
stelar7 2025-07-10 08:55:16 +02:00 committed by Jelle Raaijmakers
parent 6f756f7f6c
commit 559b9dbd83
Notes: github-actions[bot] 2025-08-27 14:15:18 +00:00
3 changed files with 42 additions and 0 deletions

View file

@ -21,6 +21,12 @@ struct IDBIndexParameters {
bool multi_entry { false };
};
struct IDBGetAllOptions {
JS::Value query { JS::js_undefined() };
Optional<WebIDL::UnsignedLong> count;
Bindings::IDBCursorDirection direction { Bindings::IDBCursorDirection::Next };
};
// https://w3c.github.io/IndexedDB/#object-store-interface
// https://w3c.github.io/IndexedDB/#object-store-handle-construct
class IDBObjectStore : public Bindings::PlatformObject {
@ -46,6 +52,7 @@ public:
[[nodiscard]] WebIDL::ExceptionOr<GC::Ref<IDBRequest>> get_key(JS::Value);
[[nodiscard]] WebIDL::ExceptionOr<GC::Ref<IDBRequest>> get_all(Optional<JS::Value>, Optional<WebIDL::UnsignedLong>);
[[nodiscard]] WebIDL::ExceptionOr<GC::Ref<IDBRequest>> get_all_keys(Optional<JS::Value>, Optional<WebIDL::UnsignedLong>);
[[nodiscard]] WebIDL::ExceptionOr<GC::Ref<IDBRequest>> get_all_records(IDBGetAllOptions const&);
[[nodiscard]] WebIDL::ExceptionOr<GC::Ref<IDBRequest>> count(Optional<JS::Value>);
[[nodiscard]] WebIDL::ExceptionOr<GC::Ref<IDBRequest>> open_cursor(JS::Value, Bindings::IDBCursorDirection = Bindings::IDBCursorDirection::Next);
[[nodiscard]] WebIDL::ExceptionOr<GC::Ref<IDBRequest>> open_key_cursor(JS::Value, Bindings::IDBCursorDirection = Bindings::IDBCursorDirection::Next);