---
title: "IDBOpenDBRequest | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Interface IDBOpenDBRequest

The **`IDBOpenDBRequest`** interface of the IndexedDB API provides access to the results of requests to open or delete databases (performed using IDBFactory.open and IDBFactory.deleteDatabase), using specific event handler attributes.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBOpenDBRequest)

interface IDBOpenDBRequest {  
    [error](#error): DOMException | null;  
    [onblocked](#onblocked):  
        | ((this: IDBOpenDBRequest, ev: [IDBVersionChangeEvent](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBVersionChangeEvent/)) \=> any)  
        | null;  
    [onerror](#onerror): ((this: [IDBRequest](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/)<[IDBDatabase](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBDatabase/)\>, ev: Event) \=> any) | null;  
    [onsuccess](#onsuccess): ((this: [IDBRequest](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/)<[IDBDatabase](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBDatabase/)\>, ev: Event) \=> any) | null;  
    [onupgradeneeded](#onupgradeneeded):  
        | ((this: IDBOpenDBRequest, ev: [IDBVersionChangeEvent](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBVersionChangeEvent/)) \=> any)  
        | null;  
    [readyState](#readystate): [IDBRequestReadyState](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.IDBRequestReadyState/);  
    [result](#result): [IDBDatabase](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBDatabase/);  
    [source](#source): [IDBObjectStore](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBObjectStore/) | [IDBIndex](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBIndex/) | [IDBCursor](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBCursor/);  
    [transaction](#transaction): [IDBTransaction](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBTransaction/) | null;  
    [addEventListener](#addeventlistener-1)<[K](#addeventlistenerk) extends keyof [IDBOpenDBRequestEventMap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBOpenDBRequestEventMap/)\>(  
        type: [K](#addeventlistenerk),  
        listener: (this: IDBOpenDBRequest, ev: [IDBOpenDBRequestEventMap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBOpenDBRequestEventMap/)\[[K](#addeventlistenerk)\]) \=> any,  
        options?: boolean | AddEventListenerOptions,  
    ): void;  
    [addEventListener](#addeventlistener-2)(  
        type: string,  
        listener: [EventListenerOrEventListenerObject](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.EventListenerOrEventListenerObject/),  
        options?: boolean | AddEventListenerOptions,  
    ): void;  
    [dispatchEvent](#dispatchevent-1)(event: Event): boolean;  
    [removeEventListener](#removeeventlistener-1)<[K](#removeeventlistenerk) extends keyof [IDBOpenDBRequestEventMap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBOpenDBRequestEventMap/)\>(  
        type: [K](#removeeventlistenerk),  
        listener: (this: IDBOpenDBRequest, ev: [IDBOpenDBRequestEventMap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBOpenDBRequestEventMap/)\[[K](#removeeventlistenerk)\]) \=> any,  
        options?: boolean | EventListenerOptions,  
    ): void;  
    [removeEventListener](#removeeventlistener-2)(  
        type: string,  
        listener: [EventListenerOrEventListenerObject](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.EventListenerOrEventListenerObject/),  
        options?: boolean | EventListenerOptions,  
    ): void;  
}

#### Hierarchy ([View Summary](https://docs.maptiler.com/sdk-js/api-reference/hierarchy/#Externals.IDBOpenDBRequest))

-   [IDBRequest](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/)<[IDBDatabase](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBDatabase/)\>
    -   IDBOpenDBRequest

##### Index

### Properties[](#properties)

[error](#error) [onblocked](#onblocked) [onerror](#onerror) [onsuccess](#onsuccess) [onupgradeneeded](#onupgradeneeded) [readyState](#readystate) [result](#result) [source](#source) [transaction](#transaction)

### Methods[](#methods)

[addEventListener](#addeventlistener) [dispatchEvent](#dispatchevent) [removeEventListener](#removeeventlistener)

## Properties[](#properties-1)

### `Readonly`error[](#error)

error: DOMException | null

The **`error`** read-only property of the IDBRequest interface returns the error in the event of an unsuccessful request.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBRequest/error)

Inherited from [IDBRequest](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/).[error](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/#error)

### onblocked[](#onblocked)

onblocked: ((this: IDBOpenDBRequest, ev: [IDBVersionChangeEvent](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBVersionChangeEvent/)) \=> any) | null

[MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBOpenDBRequest/blocked_event)

### onerror[](#onerror)

onerror: ((this: [IDBRequest](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/)<[IDBDatabase](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBDatabase/)\>, ev: Event) \=> any) | null

[MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBRequest/error_event)

Inherited from [IDBRequest](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/).[onerror](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/#onerror)

### onsuccess[](#onsuccess)

onsuccess: ((this: [IDBRequest](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/)<[IDBDatabase](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBDatabase/)\>, ev: Event) \=> any) | null

[MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBRequest/success_event)

Inherited from [IDBRequest](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/).[onsuccess](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/#onsuccess)

### onupgradeneeded[](#onupgradeneeded)

onupgradeneeded:  
    | ((this: IDBOpenDBRequest, ev: [IDBVersionChangeEvent](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBVersionChangeEvent/)) \=> any)  
    | null

[MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBOpenDBRequest/upgradeneeded_event)

### `Readonly`readyState[](#readystate)

readyState: [IDBRequestReadyState](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.IDBRequestReadyState/)

The **`readyState`** read-only property of the IDBRequest interface returns the state of the request.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBRequest/readyState)

Inherited from [IDBRequest](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/).[readyState](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/#readystate)

### `Readonly`result[](#result)

result: [IDBDatabase](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBDatabase/)

The **`result`** read-only property of the IDBRequest interface returns the result of the request.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBRequest/result)

Inherited from [IDBRequest](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/).[result](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/#result)

### `Readonly`source[](#source)

source: [IDBObjectStore](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBObjectStore/) | [IDBIndex](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBIndex/) | [IDBCursor](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBCursor/)

The **`source`** read-only property of the IDBRequest interface returns the source of the request, such as an Index or an object store. If no source exists (such as when calling IDBFactory.open), it returns null.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBRequest/source)

Inherited from [IDBRequest](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/).[source](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/#source)

### `Readonly`transaction[](#transaction)

transaction: [IDBTransaction](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBTransaction/) | null

The **`transaction`** read-only property of the IDBRequest interface returns the transaction for the request, that is, the transaction the request is being made inside.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBRequest/transaction)

Inherited from [IDBRequest](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/).[transaction](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/#transaction)

## Methods[](#methods-1)

### addEventListener[](#addeventlistener)

-   addEventListener<[K](#addeventlistenerk) extends keyof [IDBOpenDBRequestEventMap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBOpenDBRequestEventMap/)\>(  
        type: [K](#addeventlistenerk),  
        listener: (this: IDBOpenDBRequest, ev: [IDBOpenDBRequestEventMap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBOpenDBRequestEventMap/)\[[K](#addeventlistenerk)\]) \=> any,  
        options?: boolean | AddEventListenerOptions,  
    ): void[](#addeventlistener-1)
    
    The **`addEventListener()`** method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
    
    #### Type Parameters
    
    -   K extends keyof [IDBOpenDBRequestEventMap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBOpenDBRequestEventMap/)
    
    #### Parameters
    
    -   type: [K](#addeventlistenerk)
    -   listener: (this: IDBOpenDBRequest, ev: [IDBOpenDBRequestEventMap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBOpenDBRequestEventMap/)\[[K](#addeventlistenerk)\]) \=> any
    -   `Optional`options: boolean | AddEventListenerOptions
    
    #### Returns void
    
    Overrides [IDBRequest](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/).[addEventListener](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/#addeventlistener)
    
-   addEventListener(  
        type: string,  
        listener: [EventListenerOrEventListenerObject](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.EventListenerOrEventListenerObject/),  
        options?: boolean | AddEventListenerOptions,  
    ): void[](#addeventlistener-2)
    
    The **`addEventListener()`** method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
    
    #### Parameters
    
    -   type: string
    -   listener: [EventListenerOrEventListenerObject](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.EventListenerOrEventListenerObject/)
    -   `Optional`options: boolean | AddEventListenerOptions
    
    #### Returns void
    
    Overrides [IDBRequest](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/).[addEventListener](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/#addeventlistener)
    

### dispatchEvent[](#dispatchevent)

-   dispatchEvent(event: Event): boolean[](#dispatchevent-1)
    
    The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
    
    #### Parameters
    
    -   event: Event
    
    #### Returns boolean
    
    Inherited from [IDBRequest](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/).[dispatchEvent](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/#dispatchevent)
    

### removeEventListener[](#removeeventlistener)

-   removeEventListener<[K](#removeeventlistenerk) extends keyof [IDBOpenDBRequestEventMap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBOpenDBRequestEventMap/)\>(  
        type: [K](#removeeventlistenerk),  
        listener: (this: IDBOpenDBRequest, ev: [IDBOpenDBRequestEventMap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBOpenDBRequestEventMap/)\[[K](#removeeventlistenerk)\]) \=> any,  
        options?: boolean | EventListenerOptions,  
    ): void[](#removeeventlistener-1)
    
    The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
    
    #### Type Parameters
    
    -   K extends keyof [IDBOpenDBRequestEventMap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBOpenDBRequestEventMap/)
    
    #### Parameters
    
    -   type: [K](#removeeventlistenerk)
    -   listener: (this: IDBOpenDBRequest, ev: [IDBOpenDBRequestEventMap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBOpenDBRequestEventMap/)\[[K](#removeeventlistenerk)\]) \=> any
    -   `Optional`options: boolean | EventListenerOptions
    
    #### Returns void
    
    Overrides [IDBRequest](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/).[removeEventListener](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/#removeeventlistener)
    
-   removeEventListener(  
        type: string,  
        listener: [EventListenerOrEventListenerObject](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.EventListenerOrEventListenerObject/),  
        options?: boolean | EventListenerOptions,  
    ): void[](#removeeventlistener-2)
    
    The **`removeEventListener()`** method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
    
    #### Parameters
    
    -   type: string
    -   listener: [EventListenerOrEventListenerObject](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.EventListenerOrEventListenerObject/)
    -   `Optional`options: boolean | EventListenerOptions
    
    #### Returns void
    
    Overrides [IDBRequest](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/).[removeEventListener](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.IDBRequest/#removeeventlistener)
