IUnifiedStorage<I, C>
Defined in: atomiq-sdk/src/storage/IUnifiedStorage.ts:52
Interface for a generic unified storage implementations
Type Parameters
| Type Parameter |
|---|
I extends UnifiedStorageIndexes |
C extends UnifiedStorageCompositeIndexes |
Methods
init()
init(indexes, compositeIndexes): Promise<void>;
Defined in: atomiq-sdk/src/storage/IUnifiedStorage.ts:60
Initializes the storage with given indexes and composite indexes
Parameters
| Parameter | Type | Description |
|---|---|---|
indexes | I | |
compositeIndexes | C |
Returns
Promise<void>
query()
query(params): Promise<any[]>;
Defined in: atomiq-sdk/src/storage/IUnifiedStorage.ts:69
Params are specified in the following way:
- [[condition1, condition2]] - returns all rows where condition1 AND condition2 is met
- [[condition1], [condition2]] - returns all rows where condition1 OR condition2 is met
- [[condition1, condition2], [condition3]] - returns all rows where (condition1 AND condition2) OR condition3 is met
Parameters
| Parameter | Type | Description |
|---|---|---|
params | QueryParams[][] |
Returns
Promise<any[]>
remove()
remove(value): Promise<void>;
Defined in: atomiq-sdk/src/storage/IUnifiedStorage.ts:87
Removes an object from storage
Parameters
| Parameter | Type | Description |
|---|---|---|
value | any | Object to remove (must have an id property) |
Returns
Promise<void>
removeAll()
removeAll(value): Promise<void>;
Defined in: atomiq-sdk/src/storage/IUnifiedStorage.ts:93
Removes multiple objects from storage in a batch operation
Parameters
| Parameter | Type | Description |
|---|---|---|
value | any[] | Array of objects to remove |
Returns
Promise<void>
save()
save(value): Promise<void>;
Defined in: atomiq-sdk/src/storage/IUnifiedStorage.ts:75
Saves an object to storage, updating indexes as needed
Parameters
| Parameter | Type | Description |
|---|---|---|
value | any | Object to save (must have an id property) |
Returns
Promise<void>
saveAll()
saveAll(value): Promise<void>;
Defined in: atomiq-sdk/src/storage/IUnifiedStorage.ts:81
Saves multiple objects to storage in a batch operation
Parameters
| Parameter | Type | Description |
|---|---|---|
value | any[] | Array of objects to save |
Returns
Promise<void>