Module

Database.IndexedDB.IDBFactory

Package
purescript-indexeddb
Repository
truqu/purescript-indexedDB

Database objects are accessed through methods on the IDBFactory interface. A single object implementing this interface is present in the global scope of environments that support Indexed DB operations.

#Callbacks Source

type Callbacks e = { onBlocked :: Maybe (Eff e Unit), onUpgradeNeeded :: Maybe (Database -> Transaction -> { oldVersion :: Int } -> Eff e Unit) }

#DatabaseName Source

type DatabaseName = String

Type alias for DatabaseName.

#Version Source

type Version = Int

Type alias for Version.

#deleteDatabase Source

deleteDatabase :: forall e. DatabaseName -> Aff (idb :: IDB | e) Int

Attempts to delete the named database. If the database already exists and there are open connections that don’t close in response to a versionchange event, the request will be blocked until all they close.

#open Source

open :: forall e' e. DatabaseName -> Maybe Version -> Callbacks e' -> Aff (idb :: IDB | e) Database

Attempts to open a connection to the named database with the specified version. If the database already exists with a lower version and there are open connections that don’t close in response to a versionchange event, the request will be blocked until all they close, then an upgrade will occur. If the database already exists with a higher version the request will fail.

When the version isn't provided (Nothing), attempts to open a connection to the named database with the current version, or 1 if it does not already exist.