Skip to content

invalid typings for with #2749

@salisbury-espinosa

Description

@salisbury-espinosa
TestModel.query()
      .with(
        'idWithRank',
        ['id', 'rank'],
        raw(`VALUES (?, ?), (?, ?), (?, ?)`, [69, 5, 57, 3, 63, 0]),
      )

=> failed cause columns is missed in typings for WithMethod

https://github.com/Vincit/objection.js/blob/main/typings/objection/index.d.ts#L598

interface WithMethod<QB extends AnyQueryBuilder> {
    (alias: string, expr: CallbackVoid<QB> | AnyQueryBuilder | Raw): QB;
  }

but knex can add columns to the alias =>

https://knexjs.org/guide/query-builder.html#with

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions