Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • State: StateDefining

  • TableKey: RowKeyOf<State>

  • T: Row

Hierarchy

  • Query

Index

Constructors

constructor

Properties

Private db

db: DB<State>

Private table

table: Table<T>

Accessors

all

  • get all(): T[]

first

  • get first(): T | undefined

last

  • get last(): T | undefined

length

  • get length(): number

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

    • id: string

    Returns T | undefined

limit

  • limit(amount: number): Query<State, TableKey, T>
  • Parameters

    • amount: number

    Returns Query<State, TableKey, T>

offset

  • offset(amount: number): Query<State, TableKey, T>
  • Parameters

    • amount: number

    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

    • ResultType: Row

    Parameters

    • results: ResultType[]

    Returns Query<State, TableKey, ResultType>

select

  • select<K>(...fields: K[]): Query<State, TableKey, Pick<T, K> & Row>
  • Type parameters

    • K: keyof T

    Parameters

    • Rest ...fields: K[]

    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>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc