Options
All
  • Public
  • Public/Protected
  • All
Menu

This IndexedDB API interface provides a connection to a database; you can use an IDBDatabase object to open a transaction on your database then create, manipulate, and delete objects (data) in that database. The interface provides the only way to get and manage versions of the database.

Hierarchy

  • EventTarget
    • IDBDatabase

Index

Properties

name: string

Returns the name of the database.

objectStoreNames: internal.DOMStringList

Returns a list of the names of object stores in the database.

onabort: null | ((this: internal.IDBDatabase, ev: Event) => any)
onclose: null | ((this: internal.IDBDatabase, ev: Event) => any)
onerror: null | ((this: internal.IDBDatabase, ev: Event) => any)
onversionchange: null | ((this: internal.IDBDatabase, ev: internal.IDBVersionChangeEvent) => any)
version: number

Returns the version of the database.

Methods

  • addEventListener<K>(type: K, listener: ((this: internal.IDBDatabase, ev: IDBDatabaseEventMap[K]) => any), options?: boolean | AddEventListenerOptions): void
  • addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void
  • close(): void
  • Closes the connection once all running transactions have finished.

    Returns void

  • Creates a new object store with the given name and options and returns a new IDBObjectStore.

    Throws a "InvalidStateError" DOMException if not called within an upgrade transaction.

    Parameters

    Returns internal.IDBObjectStore

  • deleteObjectStore(name: string): void
  • Deletes the object store with the given name.

    Throws a "InvalidStateError" DOMException if not called within an upgrade transaction.

    Parameters

    • name: string

    Returns void

  • dispatchEvent(event: Event): boolean
  • Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

    Parameters

    • event: Event

    Returns boolean

  • removeEventListener<K>(type: K, listener: ((this: internal.IDBDatabase, ev: IDBDatabaseEventMap[K]) => any), options?: boolean | EventListenerOptions): void
  • removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void
  • Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names.

    Parameters

    Returns internal.IDBTransaction

Generated using TypeDoc