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

[FEATURE]: InArray does not support using multiple columns #3575

Open
1 task done
muhammetozendev opened this issue Nov 18, 2024 · 0 comments
Open
1 task done

[FEATURE]: InArray does not support using multiple columns #3575

muhammetozendev opened this issue Nov 18, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@muhammetozendev
Copy link

muhammetozendev commented Nov 18, 2024

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

I ran into a case where I need to use multiple columns with IN and drizzle does not seem to support it yet. Following would be an example usage:

db.select()
  .from(usersTable)
  .where(
    inArray(
      [usersTable.name, usersTable.age],
      [
        ['John', 20],
        ['Bob', 25]
      ]
    )
  );

And generated query would be as follows:

SELECT * FROM users WHERE (name, age) IN (('John', 20), ('Bob', 25));

In this case, it would be ideal to infer the type of the 2D array as [string, number][] if possible. Also it would be great to see this implemented with notInArray too. Thanks in advance

@muhammetozendev muhammetozendev added the enhancement New feature or request label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant