Class DataFinder<T, PK_Type>

Data finder

Type Parameters

Hierarchy

  • DataFinder

Constructors

  • Constructor

    Type Parameters

    • T

    • PK_Type = any

    Parameters

    • source: string

      Name of the source

    • table: string

      Name of the table

    • key: ModelKeyName<T>

      Name of the primary key

    • dataParse: ((data: TypedRow<T>) => T)

      Function to create DatModel from GenericRow

    Returns DataFinder<T, PK_Type>

Properties

dataParse: ((data: TypedRow<T>) => T)

Type declaration

key: ModelKeyName<T>
source: string
table: string

Methods

  • Delete instances

    Parameters

    • where: DataFilter<T>

      Conditions for the instances to match

    Returns Promise<number>

  • Find instance by key

    Parameters

    • keyValue: PK_Type

      The value of the primary key

    Returns Promise<T>

  • Find instances (stream) / Async callback

    Parameters

    • where: DataFilter<T>

      Conditions for the instances to match

    • orderBy: OrderBy<T>

      Order of the results

    • options: SelectOptions<T>

      Additional options

    • each: ((row: T) => Promise<void>)

      Callback for each row

        • (row: T): Promise<void>
        • Parameters

          • row: T

          Returns Promise<void>

    Returns Promise<void>

  • Find instances (stream) / Sync callback

    Parameters

    • where: DataFilter<T>

      Conditions for the instances to match

    • orderBy: OrderBy<T>

      Order of the results

    • options: SelectOptions<T>

      Additional options

    • each: ((row: T) => void)

      Callback for each row

        • (row: T): void
        • Parameters

          • row: T

          Returns void

    Returns Promise<void>

Generated using TypeDoc