any operator must be on right-hand-side of comparison operator
I don't know if there is a way to warn about this, but the following are not the same:
eventId.asColumnOf[String] === s.eventIds.any
and
s.eventIds.any === eventId.asColumnOf[String]
The latter will be rejected by Postgres.
It may be outside of the bounds of what is possible with slick, but ideally the compiler should throw a warning when the latter is encountered. (Perhaps you could define === on the return result of .any, such that using it issues a warning / refuses to compile).
I'm afraid we can't resolve it.
You know, the return result of .any is a normal Rep[T] instead of a Rep[Array[T]], so we can't find out a way to tell the compiler to use our defined ===.
I know; yes.
I'm wondering if it would be better to not define .any, and instead create a function which accepts two Rep's. Implicit proofs could be used then to verify that the comparison will work.
I'll tinker and send a patch with the idea.
Sent from my iPhone
On Aug 19, 2015, at 07:51, 涂名雷 [email protected] wrote:
I'm afraid we can't resolve it. You know, the return result of .any is a normal Rep[T] instead of a Rep[Array[T]], so we can't find out a way to tell the compiler to use our defined ===.
— Reply to this email directly or view it on GitHub.
Are you going to define an .anyEquals method, which accept a Rep[_] parameter?
If that's right, how about >, <, >=, <=, <> ?