Class FilterWhereBuilder<TData, TVirtual, TInstance, TRelations>

Typed facade around the legacy QueryBuilder. It injects default revision-aware predicates, exposes the fluent DAL surface, and keeps the PromiseLike contract so await Model.filterWhere(...) call sites work without forcing .run().

Type Parameters

Implements

Constructors

Methods

  • Parameters

    • literal: Partial<
          {
              [K in string
              | number
              | symbol]: TData[K] | OperatorResultForKey<FilterWhereOperators<TData>, K>
          },
      >

    Returns this

  • Atomically decrement a numeric column scoped by the current predicates.

    Type Parameters

    • K extends string
    • R extends string = K

    Parameters

    • field: K

      Numeric model field to decrement

    • options: { by?: number; returning?: R[] } = {}

      Configure the decrement step and returned columns

    Returns Promise<{ rowCount: number; rows: Pick<TData, R>[] }>

  • Atomically increment a numeric column scoped by the current predicates.

    Type Parameters

    • K extends string
    • R extends string = K

    Parameters

    • field: K

      Numeric model field to increment

    • options: { by?: number; returning?: R[] } = {}

      Configure the increment step and returned columns

    Returns Promise<{ rowCount: number; rows: Pick<TData, R>[] }>

  • Parameters

    • literal: Partial<
          {
              [K in string
              | number
              | symbol]: TData[K] | OperatorResultForKey<FilterWhereOperators<TData>, K>
          },
      >

    Returns this

  • Order results by a model column.

    Parameters

    • field: string | Extract<keyof TData, string>

      Field to sort by (camelCase or qualified string)

    • direction: "ASC" | "DESC" = 'ASC'

      Sort direction

    Returns this

  • Order results using a column on a joined relation (through metadata).

    Parameters

    • relation: TRelations

      Relation key from the manifest

    • field: string

      Column on the related table (camelCase)

    • direction: "ASC" | "DESC" = 'ASC'

      Sort direction

    Returns this