Module

Web.IDB

Package
purescript-idb
Repository
philippedev101/purescript-idb

PureScript FFI bindings for IndexedDB via the idb library.

All operations run in Aff and work with any IndexedDB-compatible environment (browsers, or Node.js with fake-indexeddb).

#IDBDatabase Source

data IDBDatabase

An opaque handle to an open IndexedDB database.

#open Source

open :: String -> Int -> Array String -> Aff IDBDatabase

Open (or create) a database. Creates any missing object stores.

#get Source

get :: IDBDatabase -> String -> String -> Aff (Maybe Foreign)

Get a value by key from a store. Returns Nothing if not found.

#getAll Source

getAll :: IDBDatabase -> String -> Aff (Array Foreign)

Get all values from a store.

#put Source

put :: IDBDatabase -> String -> String -> Foreign -> Aff Unit

Put a value at a key in a store (upsert).

#delete Source

delete :: IDBDatabase -> String -> String -> Aff Unit

Delete a key from a store.

#clear Source

clear :: IDBDatabase -> String -> Aff Unit

Clear all entries in a store.

Modules
Web.IDB