Type parameters
-
State: StateDefining
-
TableKey: RowKeyOf<State>
-
T: Row
Accessors
first
- get first(): T | undefined
last
- get last(): T | undefined
Methods
embed
- embed<Key, SecondaryTable, JoinKey, Embed>(key: Key, table: SecondaryTable, source: JoinKey): Query<State, TableKey, T & Record<Key, undefined extends T[JoinKey] ? Embed | undefined : Embed>>
-
Type parameters
-
Key: string
-
SecondaryTable: RowKeyOf<State>
-
JoinKey: keyof T
-
Embed
Parameters
-
key: Key
-
table: SecondaryTable
-
source: JoinKey
Returns Query<State, TableKey, T & Record<Key, undefined extends T[JoinKey] ? Embed | undefined : Embed>>
embedMulti
- embedMulti<Key, SecondaryTable, JoinKey, Embed>(key: Key, table: SecondaryTable, source: JoinKey): Query<State, TableKey, T & Record<Key, Embed[]>>
-
Type parameters
-
Key: string
-
SecondaryTable: RowKeyOf<State>
-
JoinKey: keyof T
-
Embed
Parameters
-
key: Key
-
table: SecondaryTable
-
source: JoinKey
Returns Query<State, TableKey, T & Record<Key, Embed[]>>
find
- find(id: string): T | undefined
-
Parameters
Returns T | undefined
limit
- limit(amount: number): Query<State, TableKey, T>
-
Parameters
Returns Query<State, TableKey, T>
offset
- offset(amount: number): Query<State, TableKey, T>
-
Parameters
Returns Query<State, TableKey, T>
orderBy
- orderBy(sortDescriptor: SortDescriptor<T>): Query<State, TableKey, T>
-
Parameters
-
sortDescriptor: SortDescriptor<T>
Returns Query<State, TableKey, T>
Private queryFromResults
- queryFromResults<ResultType>(results: ResultType[]): Query<State, TableKey, ResultType>
-
Type parameters
Parameters
Returns Query<State, TableKey, ResultType>
select
- select<K>(...fields: K[]): Query<State, TableKey, Pick<T, K> & Row>
-
Type parameters
Parameters
Returns Query<State, TableKey, Pick<T, K> & Row>
where
- where(query: ((value: T) => boolean) | Partial<T>): Query<State, TableKey, T>
-
Parameters
-
query: ((value: T) => boolean) | Partial<T>
Returns Query<State, TableKey, T>