class InMemoryDatastore
In memory Datastore implementation.
This is suitable for testing and single instance demonstration purposes.
Methods
createEntity(workspaceId, type, item)
Name | Type | Description |
---|---|---|
|
|
|
|
|
Entity type or "table" name |
|
|
|
Returns |
|
createEntity(workspaceId: string, type: string, item: any): Promise<any>;
deleteEntity(workspaceId, type, id)
Name | Type | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
Returns |
|
deleteEntity(workspaceId: string, type: string, id: string): Promise<void>;
deleteMany(workspaceId, type, query)
Name | Type | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
Returns |
|
deleteMany(workspaceId: string, type: string, query: Query): Promise<void>;
findEntity(workspaceId, type, query, sorting)
Name | Type | Description |
---|---|---|
|
|
|
|
|
Entity type or "table" name |
|
|
Json object to match fields |
|
|
|
Returns |
|
findEntity(workspaceId: string, type: any, query: Query, sorting?: DataSorting): Promise<Record[]>;
findEntityPaginated(workspaceId, type, query, sorting, page, pageSize)
Name | Type | Description |
---|---|---|
|
|
|
|
|
Entity type or "table" name |
|
|
Json object to match fields |
|
|
|
|
|
page count |
|
|
page size |
Returns |
|
findEntityPaginated(workspaceId: string, type: string, query: Query, sorting: DataSorting, page: number, pageSize: number): Promise<PagedRecords>;
getEntity(workspaceId, type, id)
Name | Type | Description |
---|---|---|
|
|
|
|
|
Entity type or "table" name |
|
|
|
Returns |
|
getEntity(workspaceId: string, type: any, id: string): Promise<Record>;
on(event, listener)
Name | Type | Description |
---|---|---|
|
|
|
|
|
|
Returns |
|
on(event: "transaction.start" | "transaction.commit", listener: (name: string, data: TransactionData) => void): this;