adrianbrowning / prisma-ts-select

A TypeSafe primsa extension allowing more fine grain control of selects
MIT License
2 stars 0 forks source link

Where: Support for "<table>.<column>" Array of values #30

Open adrianbrowning opened 2 months ago

adrianbrowning commented 2 months ago

Currently if you want to do an AND for the same column you would need to do:

prisma.$from("User")
      .join("Post", "id", "User.name")
      .where({
       $AND:[
          {  "User.name": "fred" },
          {  "User.name": "frank" },
          {  "User.name": "dave" },
]  
      }) ;

A nicer way would be:

prisma.$from("User")
      .join("Post", "id", "User.name")
      .where({
       "User.name": ["fred", "frank", "dave"]
        /*or*/
       "User.name": [{op: "LIKE", value: "f%"}, {op: "LIKE", value: "d%"}]
      }) ;