Interface Store

This interface includes the methods which are required in a data store implementation.

It expects data to be organized as dictionaries of data sets and data records, where data set refers to a specific data type (i.e. 'wellbore-headers') and records to a specific item in the set indexed by a key (i.e. wellbore id)

get: retrieve a single record from the specified data set with the specified key all: retrieve all records from the specified data set query: retrieve all records from the specified data set matching the query partial values set: set a single record into the specified data set with the specified key

Example of using query to retrieve all wellbore headers for a specific well:

const wellbores = await mystore.query<WellboreHeader>('wellbore-headers', { well: 'NO 16/2' })
interface Store {
    all: <T>(dataType: string) => Promise<null | T[]>;
    get: <T>(dataType: string, key: KeyType) => Promise<null | T>;
    query: <T>(dataType: string, query: Partial<T>) => Promise<T[]>;
    set: <T>(dataType: string, key: KeyType, value: T) => Promise<boolean>;
}

Properties

Properties

all: <T>(dataType: string) => Promise<null | T[]>

get all records from a data set

get: <T>(dataType: string, key: KeyType) => Promise<null | T>

get a single record by key from a data set

query: <T>(dataType: string, query: Partial<T>) => Promise<T[]>

get records matching the query partial object from a data set

set: <T>(dataType: string, key: KeyType, value: T) => Promise<boolean>

add a single record to a data set with the specified key