Skip to main content

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

Class: Store

Implements

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Store(options, collections?): Store

Parameters

NameType
optionsRxDatabaseCreator<any, any>
collections?CollectionList

Returns

Store

Defined in

src/pluto/rxdb/Store.ts:14

Properties

_db

Private Optional _db: RxDatabase<CollectionsOfDatabase, any, any>

Defined in

src/pluto/rxdb/Store.ts:12


collections

Private Optional Readonly collections: CollectionList

Defined in

src/pluto/rxdb/Store.ts:16


options

Private Readonly options: RxDatabaseCreator<any, any>

Defined in

src/pluto/rxdb/Store.ts:15

Accessors

db

get db(): RxDatabase<CollectionsOfDatabase, any, any>

Returns

RxDatabase<CollectionsOfDatabase, any, any>

Defined in

src/pluto/rxdb/Store.ts:25

Methods

cleanup

cleanup(): Promise<void>

Use with caution, this will remove all entries from database

Returns

Promise<void>

Defined in

src/pluto/rxdb/Store.ts:98


clear

clear(): Promise<void>

Use with caution, this will remove all entries from database and then destroy the database itself.

Returns

Promise<void>

Defined in

src/pluto/rxdb/Store.ts:110


delete

delete(name, uuid): Promise<void>

Deleting a row in the Store

Parameters

NameType
namestring
uuidstring

Returns

Promise<void>

Implementation of

Store.delete

Defined in

src/pluto/rxdb/Store.ts:61


getCollection

getCollection(name): RxCollection<any, , , >

Parameters

NameType
namestring

Returns

RxCollection<any, , , >

Defined in

src/pluto/rxdb/Store.ts:73


insert

insert(name, data): Promise<void>

Persist new data in the Store.

Parameters

NameTypeDescription
namestringtable name
dataanyobject to save

Returns

Promise<void>

Implementation of

Store.insert

Defined in

src/pluto/rxdb/Store.ts:90


query

query<T>(name, query?): Promise<any>

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<any>

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")

Implementation of

Store.query

Defined in

src/pluto/rxdb/Store.ts:82


start

start(): Promise<void>

Start the database and build collections

Returns

Promise<void>

Implementation of

Store.start

Defined in

src/pluto/rxdb/Store.ts:36


update

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

Updating a new row in the Store

Type parameters

NameType
Textends Storable

Parameters

NameType
namestring
modelT

Returns

Promise<void>

Implementation of

Store.update

Defined in

src/pluto/rxdb/Store.ts:47