开发者

quote table names in squeryl

开发者 https://www.devze.com 2023-01-31 03:18 出处:网络
I have a table named group in a mysql db. When I map this table to squeryl I get SQL synt开发者_JAVA百科ax errors since the table name group is not quoted (should be select * from `group`).

I have a table named group in a mysql db. When I map this table to squeryl I get SQL synt开发者_JAVA百科ax 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?


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.)


Have you tried :

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

?

0

精彩评论

暂无评论...
验证码 换一张
取 消