Interface QueryArray<M, T>

interface QueryArray<M, T> {
    cache(options: undefined | {
        key: string;
        refresh?: boolean;
        ttl: number;
    }): QueryArray<M, T>;
    clone(): QueryArray<M, T>;
    count(): PromiseLike<number>;
    delete(options?: any): PromiseLike<number>;
    distinct(): QueryArray<M, T>;
    endif(): QueryArray<M, T>;
    exec(options?: {
        skip_log?: boolean;
    }): PromiseLike<T[]>;
    explain(): PromiseLike<any>;
    find(id: CormoTypesRecordID): QuerySingle<M, T>;
    find(id: CormoTypesRecordID[]): QueryArray<M, T>;
    findPreserve(id: CormoTypesRecordID[]): QueryArray<M, T>;
    group<G, F>(group_by: G | G[], fields?: F): QueryArray<M, {
        [field in string | number | symbol]: number
    } & Pick<M, G>>;
    group<F>(group_by: null, fields?: F): QueryArray<M, {
        [field in string | number | symbol]: number
    }>;
    group<U>(group_by: null | string, fields?: object): QueryArray<M, U>;
    if(condition: boolean): QueryArray<M, T>;
    include(column: string, select?: string): QueryArray<M, T>;
    index_hint(hint: string): QueryArray<M, T>;
    join(model: typeof BaseModel, options?: {
        alias?: string;
        base_column?: string;
        join_column?: string;
    }): QueryArray<M, T>;
    lean(lean?: boolean): QueryArray<M, T>;
    left_outer_join(model: typeof BaseModel, options?: {
        alias?: string;
        base_column?: string;
        join_column?: string;
    }): QueryArray<M, T>;
    limit(limit?: number): QueryArray<M, T>;
    near(target: object): QueryArray<M, T>;
    one(): QuerySingleNull<M, T>;
    order(orders?: string): QueryArray<M, T>;
    select<K>(columns: K[]): QueryArray<M, Pick<M, K>>;
    select<K>(columns?: string): QueryArray<M, Pick<M, K>>;
    selectSingle<K>(column: K): QueryArray<M, M[K]>;
    skip(skip?: number): QueryArray<M, T>;
    stream(): Readable;
    then<TResult1, TResult2>(onfulfilled?: null | ((value: T[]) => TResult1 | PromiseLike<TResult1>), onrejected?: null | ((reason: any) => TResult2 | PromiseLike<TResult2>)): PromiseLike<TResult1 | TResult2>;
    transaction(transaction?: Transaction): QueryArray<M, T>;
    update(updates: object): PromiseLike<number>;
    upsert(updates: object, options?: {
        ignore_on_update: string[];
    }): PromiseLike<void>;
    using(node: "master" | "read"): QueryArray<M, T>;
    where(condition?: object): QueryArray<M, T>;
}

Type Parameters

Hierarchy

  • PromiseLike<T[]>
    • QueryArray

Implemented by

Methods

  • Parameters

    • Optionaloptions: {
          skip_log?: boolean;
      }
      • Optionalskip_log?: boolean

    Returns PromiseLike<T[]>

  • Parameters

    • model: typeof BaseModel
    • Optionaloptions: {
          alias?: string;
          base_column?: string;
          join_column?: string;
      }
      • Optionalalias?: string
      • Optionalbase_column?: string
      • Optionaljoin_column?: string

    Returns QueryArray<M, T>

  • Parameters

    • model: typeof BaseModel
    • Optionaloptions: {
          alias?: string;
          base_column?: string;
          join_column?: string;
      }
      • Optionalalias?: string
      • Optionalbase_column?: string
      • Optionaljoin_column?: string

    Returns QueryArray<M, T>

  • Attaches callbacks for the resolution and/or rejection of the Promise.

    Type Parameters

    • TResult1 = T[]
    • TResult2 = never

    Parameters

    • Optionalonfulfilled: null | ((value: T[]) => TResult1 | PromiseLike<TResult1>)

      The callback to execute when the Promise is resolved.

    • Optionalonrejected: null | ((reason: any) => TResult2 | PromiseLike<TResult2>)

      The callback to execute when the Promise is rejected.

    Returns PromiseLike<TResult1 | TResult2>

    A Promise for the completion of which ever callback is executed.

  • Parameters

    • updates: object
    • Optionaloptions: {
          ignore_on_update: string[];
      }
      • ignore_on_update: string[]

    Returns PromiseLike<void>