I'm using scalaquery on a sqlite database (with the zentus jdbc driver), but when I select with a left join, I got the following Exception :
Caused by: java.sql.SQLException: unrecognized token: "{"
at org.sqlite.DB.throwex(DB.java:288)
at org.sqlite.NativeDB.prepare(Native Method)
at org.sqlite.DB.prepare(DB.java:114)
at org.sqlite.PrepStmt.<init>(PrepStmt.java:37)
at org.sqlite.Conn.prepareStatement(Conn.java:231)
at org.sqlite.Conn.prepareStatement(Conn.java:224)
at org.scalaquery.session.Session$class.prepareStatement(Session.scala:25)
at org.scalaquery.session.BaseSession.prepareStatement(Session.scala:92)
at org.scalaquery.StatementInvoker.results(StatementInvoker.scala:59)
...
My query is :
val qSong = for{
Join(song,score) <- Songs leftJoin Scores on (_.hash is _.hash)
__ <- Query orderBy song.title
} yield song.title ~ song.difficulty ~ song.level ~ song.mode ~ score.perfect ~ score.great
And when I print the generated query, it give me this :
SELECT "t2"."title","t2"."difficulty","t2"."level","t2"."mode","t3"."perfect","t3"."great" FROM {oj "song" "t2" left outer join "score" "t3" on ("t2"."hash"="t3"."hash")} ORDER BY "t2"."title"
It's seems it comes from the {oj
part that's the driver doesn't handle.
So is there a way to make a left join without the oj
keyword ? Or is there another driver which handle it ?
Thanks.