Add InTuples expression for multi-column IN expression#3124
Conversation
|
Hi @rbygrave I like that feature, unfortunately it will not work on all databases. On DB2 you have to use On SqlServer, you have to do other tricks, like subqueries or just a simple conjunction of ANDs / ORs. BTW: What do you think about this syntax? var query = new QContact()
.firstName.isNotNull()
.email.isNotNull()
.inTuples(c.firstName, c.lastName)
.add("Rob", "B")
.add("Bob", "C")
.add("Mob", "D")
.endTuple()
.query();Roland. |
Oh, I didn't know DB2 supported it via that syntax with
Yes. It's almost easier to use concat functions and use a plain IN which is what we have with
Well I expect the normal case is that we have a collection of things ... and iterate the collection calling Hmmm, let me think about it. |
Do you plan to make a fallback implementation for platforms that do not support tuples? I really like that, as we are often using this here (we use and/or queries), so it would be great, if we can get some benefits, if the platfrom supports it Some thoughts:
|
Yes, that is the plan. I'll look to release as it is in 13.20.1 and add an implementation for DB2 & SQLServer later. [Rant, why is it that 2 of the largest tech companies on the planet can't implement this like everyone else ??? ]
This is what I thought InTuples will have to do for SQLServer. In theory people can do the concat + IN today but perhaps need guidance / example to show them. |
Example
Note this is currently not supported by SQLServer or DB2.