jerni
a framework to build data-driven products from the ground up

Type:Store
Namespace:jerni
Extends:Object

Properties

meta:
StoreMetaData

metadata of the store, can be used for analyses and optimizations

name:
string

name of the store

registerModels:
(Record<model:DataModel,store:Store>) => Promise<void>

internal use: lets a store register its models for getReader(model) to work.

getDriver:
([DataModel]) => Promise<NativeReadOnlyDriver>

internal use: returns native data query object

handleEvents:
(CommittedEvent[]) => Promise<Operation[]>

projects a batch of events into a batch of storage layer's operations, and idempotently apply those operations

getLastSeenId:
() => Promise<number>

returns the last fully persisted ID

listen:
() => AsyncIterable<number>

returns an async iterable that yields with the latest fully persisted ID

clean:
() => Promise<void>

cleans up storage layer. No effect in production mode

toString:
() => string

returns a human-readable representation of the store

dispose:
() => Promise<void>

cleans up all resouces created by this store instance. This will not clean up any data in storage layer