Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

quote table names in squeryl

Tags:

scala

squeryl

I have a table named group in a mysql db. When I map this table to squeryl I get SQL syntax errors since the table name group is not quoted (should be select * from `group`).

Is there any way I can tell squeryl to quote certain table names?

like image 946
Fredrik Jansson Avatar asked Dec 16 '10 13:12

Fredrik Jansson


2 Answers

GROUP is a reserved word in SQL, so I'd recommend renaming your table to something else. (I'm guessing this is the cause of this issue.)

like image 143
John Parker Avatar answered Oct 15 '22 02:10

John Parker


Have you tried :

val groups = table[Group]("`group`")

?

like image 2
Max L. Avatar answered Oct 15 '22 01:10

Max L.