Module

Database.IndexedDB.IDBFactory

Package
purescript-indexed-db
Repository
ilyakooo0/purescript-indexed-DB

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 = { onBlocked :: Maybe (Effect Unit), onUpgradeNeeded :: Maybe (Database -> Transaction -> { oldVersion :: Int } -> Effect Unit) }

#DatabaseName Source

type DatabaseName = String

Type alias for DatabaseName.

#Version Source

type Version = Int

Type alias for Version.

#deleteDatabase Source

deleteDatabase :: DatabaseName -> Aff 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 :: DatabaseName -> Maybe Version -> Callbacks -> Aff 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.