Skip to content

invalid typings for with #2749

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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