Skip to content

IDBRequest

Generated from idl/indexeddb.webidl when the site was built at 7aa23e2.

IDBRequest is an interface in idl/indexeddb.webidl, inheriting EventTarget, exposed in Window, Worker. What it does is on MDN; this page says what niso has of it.

The web features its members belong to, each with its Baseline status on the web and how much of the feature’s WPT suite passes in niso (see Web platform support).

Feature On the web In niso Members
IndexedDB Widely available Partial 95% 2929 of 3061 subtests pass 8
attribute
[NisoGlue] readonly attribute any result;
attribute
[NisoGlue] readonly attribute DOMException? error;
attribute
readonly attribute object? source;
int32_t niso_idb_request_get_source(niso_dom* dom, niso_handle self, niso_handle* out);

The standard’s type is (IDBObjectStore or IDBIndex or IDBCursor)?.

attribute
readonly attribute IDBTransaction? transaction;
int32_t niso_idb_request_get_transaction(niso_dom* dom, niso_handle self, niso_handle* out);
attribute
readonly attribute IDBRequestReadyState readyState;
int32_t niso_idb_request_get_ready_state(niso_dom* dom, niso_handle self, niso_str* out);
attribute
attribute EventHandler onsuccess;
int32_t niso_idb_request_get_onsuccess(niso_dom* dom, niso_handle self, void** out);
int32_t niso_idb_request_set_onsuccess(niso_dom* dom, niso_handle self, niso_event_handler_non_null_fn value_fn, void* value_userdata, niso_drop_fn value_drop);

Event handlers:

attribute
attribute EventHandler onerror;
int32_t niso_idb_request_get_onerror(niso_dom* dom, niso_handle self, void** out);
int32_t niso_idb_request_set_onerror(niso_dom* dom, niso_handle self, niso_event_handler_non_null_fn value_fn, void* value_userdata, niso_drop_fn value_drop);
operation not in JS
[NisoInternal] unsigned long long resultState();
int32_t niso_idb_request_result_state(niso_dom* dom, niso_handle self, uint64_t* out);

The result’s kind, which changes each time the result is set: how many times it was set times 4, plus 0 for a value (resultValue), 1 for an object (resultObject), or 2 for a list of records. Throws an “InvalidStateError” DOMException while the request is pending.

operation not in JS
[NisoInternal] any resultValue();
int32_t niso_idb_request_result_value(niso_dom* dom, niso_handle self, niso_bytes* out);

A value result, or the records as an Array of [key, primary key, value].

operation not in JS
[NisoInternal] object? resultObject();
int32_t niso_idb_request_result_object(niso_dom* dom, niso_handle self, niso_handle* out);
operation not in JS
[NisoInternal] any errorInfo();
int32_t niso_idb_request_error_info(niso_dom* dom, niso_handle self, niso_bytes* out);

The error as [id, error code, message], or null; the id names the one DOMException the binding makes for it. Throws as resultState does.

Members the web has, by the BCD keys web-features 3.45.0 lists, that idl/ doesn’t declare. The list is partial: web-features lists only the keys it maps to a feature.

  • worker_support (IndexedDB)