Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is Raw type missing in onIn JoinClause ? #4285

Closed
qchapelet opened this issue Feb 9, 2021 · 1 comment · Fixed by #4830
Closed

Is Raw type missing in onIn JoinClause ? #4285

qchapelet opened this issue Feb 9, 2021 · 1 comment · Fixed by #4830
Assignees

Comments

@qchapelet
Copy link

qchapelet commented Feb 9, 2021

Environment

Knex version: 0.21.6
Knex types version: 0.16.1
Database + version: mssql 6.2.3

Feature discussion / request

I want to perform a subquery with an in operator like so

SELECT * FROM myTable JOIN myOtherTable on myOtherTable.myField IN ( mySubQuery )

Actually, I have found how to do it but it's not clear since i'm forcing unknow cast :

.leftJoin('myOtherTable ', function (this: Knex.JoinClause) {
      this.onIn(
        'myOtherTable.myField',
        (db.raw(
          '(mySubQuery)',
        ) as unknown) as string[],
      )
    })

The expected type of onIn values is any[]. So I'm wondering why I have to cast it as unknow and if i could have done it in another way ? Is Raw type missing in the expected values ?

Thanks

@lorefnon

@kibertoad
Copy link
Collaborator

Released in 1.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants