mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-27 12:46:06 +00:00
LibWeb/IDB: Implement IDBDatabase::createObjectStore
This commit is contained in:
parent
3c5578cc87
commit
1057c88fdd
Notes:
github-actions[bot]
2025-03-27 15:49:41 +00:00
Author: https://github.com/stelar7
Commit: 1057c88fdd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4077
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/gmta ✅
7 changed files with 102 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2024, stelar7 <dudedbz@gmail.com>
|
||||
* Copyright (c) 2024-2025, stelar7 <dudedbz@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -11,10 +11,19 @@
|
|||
#include <LibWeb/HTML/DOMStringList.h>
|
||||
#include <LibWeb/IndexedDB/IDBRequest.h>
|
||||
#include <LibWeb/IndexedDB/Internal/Database.h>
|
||||
#include <LibWeb/IndexedDB/Internal/ObjectStore.h>
|
||||
#include <LibWeb/StorageAPI/StorageKey.h>
|
||||
|
||||
namespace Web::IndexedDB {
|
||||
|
||||
using KeyPath = Variant<String, Vector<String>>;
|
||||
|
||||
// https://w3c.github.io/IndexedDB/#dictdef-idbobjectstoreparameters
|
||||
struct IDBObjectStoreParameters {
|
||||
Optional<KeyPath> key_path;
|
||||
bool auto_increment { false };
|
||||
};
|
||||
|
||||
// FIXME: I'm not sure if this object should do double duty as both the connection and the interface
|
||||
// but the spec treats it as such...?
|
||||
// https://w3c.github.io/IndexedDB/#IDBDatabase-interface
|
||||
|
@ -44,6 +53,8 @@ public:
|
|||
[[nodiscard]] ConnectionState state() const { return m_state; }
|
||||
[[nodiscard]] GC::Ref<Database> associated_database() { return m_associated_database; }
|
||||
|
||||
WebIDL::ExceptionOr<GC::Ref<IDBObjectStore>> create_object_store(String const&, IDBObjectStoreParameters const&);
|
||||
|
||||
void close();
|
||||
|
||||
void set_onabort(WebIDL::CallbackType*);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue