StoreQueries
A class that provides a 'namespace' for the various kinds of indexes one may wish to derive from the record store.
class StoreQueries<R extends UnknownRecord> {}
Constructs a new instance of the StoreQueries
class
Name | Description |
---|---|
|
|
|
|
Methods
exec<TypeName extends R['typeName']>(
typeName: TypeName,
query: QueryExpression<
Extract<
R,
{
typeName: TypeName
}
>
>
): Array<
Extract<
R,
{
typeName: TypeName
}
>
>
Name | Description |
---|---|
|
|
|
|
Array<
Extract<
R,
{
typeName: TypeName
}
>
>
Create a derivation that contains the history for a given type
filterHistory<TypeName extends R['typeName']>(
typeName: TypeName
): Computed<
number,
RecordsDiff<
Extract<
R,
{
typeName: TypeName
}
>
>
>
Name | Description |
---|---|
|
The name of the type to filter by. |
Computed<
number,
RecordsDiff<
Extract<
R,
{
typeName: TypeName
}
>
>
>
A derivation that returns the ids of all records of the given type.
Create a derivation that will return the ids of all records of the given type.
ids<TypeName extends R['typeName']>(
typeName: TypeName,
queryCreator?: () => QueryExpression<
Extract<
R,
{
typeName: TypeName
}
>
>,
name?: string
): Computed<
Set<
IdOf<
Extract<
R,
{
typeName: TypeName
}
>
>
>,
CollectionDiff<
IdOf<
Extract<
R,
{
typeName: TypeName
}
>
>
>
>
Name | Description |
---|---|
|
The name of the type. |
|
A function that returns the query expression. |
|
(optinal) The name of the query. |
Computed<
Set<
IdOf<
Extract<
R,
{
typeName: TypeName
}
>
>
>,
CollectionDiff<
IdOf<
Extract<
R,
{
typeName: TypeName
}
>
>
>
>
Create a derivation that returns an index on a property for the given type.
index<
TypeName extends R['typeName'],
Property extends string &
keyof Extract<
R,
{
typeName: TypeName
}
>,
>(
typeName: TypeName,
property: Property
): RSIndex<
Extract<
R,
{
typeName: TypeName
}
>,
Property
>
Name | Description |
---|---|
|
The name of the type. |
|
The name of the property. |
RSIndex<
Extract<
R,
{
typeName: TypeName
}
>,
Property
>
Create a derivation that will return a signle record matching the given query.
It will return undefined if there is no matching record
record<TypeName extends R['typeName']>(
typeName: TypeName,
queryCreator?: () => QueryExpression<
Extract<
R,
{
typeName: TypeName
}
>
>,
name?: string
): Computed<
| Extract<
R,
{
typeName: TypeName
}
>
| undefined
>
Name | Description |
---|---|
|
The name of the type? |
|
A function that returns the query expression. |
|
(optinal) The name of the query. |
Computed<
| Extract<
R,
{
typeName: TypeName
}
>
| undefined
>
Create a derivation that will return an array of records matching the given query
records<TypeName extends R['typeName']>(
typeName: TypeName,
queryCreator?: () => QueryExpression<
Extract<
R,
{
typeName: TypeName
}
>
>,
name?: string
): Computed<
Array<
Extract<
R,
{
typeName: TypeName
}
>
>
>
Name | Description |
---|---|
|
The name of the type? |
|
A function that returns the query expression. |
|
(optinal) The name of the query. |
Computed<
Array<
Extract<
R,
{
typeName: TypeName
}
>
>
>