Does Prisma support filtering with IN by tuples, e...
# orm-help
o
Does Prisma support filtering with IN by tuples, e.g.:
Copy code
SELECT * FROM table
WHERE (letter, number) IN (('T', 7), ('R', 2))
where table is:
Copy code
number | letter
  7    |   'T'
  2    |   'R'
  4    |   'T'
if not, joined workaround?
m
Try like this:
Copy code
prisma.table.findMany({
  where: {
    OR: [
      {
        letter: 'T',
        number: 7,
      },
      {
        letter: 'R',
        number: 2,
      },
    ],
  },
});
o
The above translates to:
Copy code
SELECT * FROM table
WHERE (letter = 'T' and number = 7) or (letter = 'R' and number = 2)
which is not quite the same from an execution plan perspective.
m
Hmm I have thought it is the same, sorry I'm not an SQL expert.
r
@Oleg Komarov 👋 Currently you would need to use a raw query as tuples are not supported. It would be great if you could create a feature request so that we can look into this.
o
@Ryan Did it a couple of days ago, let me know if I need to add detail
👍 1