2

I'm trying to use Esqueleto on an existing database and I encountered this problem : two columns that I need to join are of a different types. One is Integer (normal), the other (the "foreign key") is a String instead of being an Integer :-(

Writting the join in standard SQL works fine, but with Esqueleto, it complains that types mismtach (which is true but I don't care). Is there a workaround (like doing a 'convert' in Esqueleto or being able to add raw ON criteria) ??

mb14
  • 22,276
  • 7
  • 60
  • 102
  • 1
    In what flavour of SQL is it OK to join integers to strings and what does that mean? It's not OK in Postgres. – Tom Ellis Apr 27 '14 at 19:29
  • @tom: MySQL. Apparently it convert the string into Int. `SELECT 1 == "1 hello" => 1. – mb14 Apr 27 '14 at 19:39

0 Answers0