Skip to main content

@atala/prism-wallet-sdk / Exports / Pluto / Store

Interface: Store

Pluto.Store

Implemented by

Table of contents

Methods

Methods

delete

delete(table, uuid): Promise<void>

Deleting a row in the Store

Parameters

NameType
tablestring
uuidstring

Returns

Promise<void>

Defined in

src/pluto/Pluto.ts:101


insert

insert<T>(name, model): Promise<void>

Persist new data in the Store.

Type parameters

NameType
Textends Storable

Parameters

NameTypeDescription
namestringtable name
modelTobject to save

Returns

Promise<void>

Defined in

src/pluto/Pluto.ts:87


query

query<T>(name, query?): Promise<T[]>

Run a query to fetch data from the Store

Type parameters

NameType
Textends Storable

Parameters

NameTypeDescription
namestringModel name
query?MangoQuery<T>a MangoQuery object, a set of values and operators defining the query properties within an object will be AND'ed different objects will be OR'd

Returns

Promise<T[]>

relevant Models

Example

search for a model in TableOne with uuid and name

  store.query("TableOne", { selector: { uuid: "1", name: "eg" }})

Example

search for models in TableOne with uuid of 1 or 2

  store.query("TableOne", { selector: { $or: [{ uuid: "1" }, { uuid: "2" }] }})

Example

search for all models in TableOne

  store.query("TableOne")

Defined in

src/pluto/Pluto.ts:79


start

start(): Promise<void>

Handle any necessary startup. Will be called first before any usage, if provided.

Returns

Promise<void>

Defined in

src/pluto/Pluto.ts:50


update

update<T>(table, model): Promise<void>

Updating a new row in the Store

Type parameters

NameType
Textends Storable

Parameters

NameType
tablestring
modelT

Returns

Promise<void>

Defined in

src/pluto/Pluto.ts:94