[JDBC-146] insert! params cannot contain keys of reserved words Created: 19/Oct/16 Updated: 20/Oct/16 Resolved: 20/Oct/16
|Reporter:||Toshiki Takeuchi||Assignee:||Sean Corfield|
A parameters map of insert! cannot contain keys of reserved words. For example, because "contain" is a reserved word of MySQL, the following code will cause MySQLSyntaxErrorException.
A workaround is using quoted string as a key of the map.
However, I think that all keys of the params map should be quoted by default.
|Comment by Sean Corfield [ 20/Oct/16 12:17 AM ]|
Read the documentation for the :entities option which allows you to quote SQL column names.
|Comment by Sean Corfield [ 20/Oct/16 12:18 AM ]|
(note also that you can also specify :entities as a default in the db-spec as of the most recent version of java.jdbc)
|Comment by Toshiki Takeuchi [ 20/Oct/16 12:25 AM ]|
Oh, I didn't notice :entities option...