korma / Korma

Tasty SQL for Clojure.
http://sqlkorma.com
1.47k stars 222 forks source link

enable to specify MySQL extra parameters, especially to support non-ascii characters #259

Closed federkasten closed 9 years ago

federkasten commented 9 years ago

I added :extra option into korma.db/mysql function.

To support non-ascii characters in MySQL, we have to append some query parameters JDBC URI, such as ?useUnicode=true&characterEncoding=utf8.

Using this PR, you can specify query parameters as hash-map, for example,

(mysql {:db "mydb" :user "root" :extra {"useUnicode" true "characterEncoding" "utf8"}})

Thanks.

immoh commented 9 years ago

There's a similar PR for adding the same functionality for Postgres: #227. I would be more inclined to merge a PR that adds this functionality for all dbs that support it.

federkasten commented 9 years ago

I can agree with it. I will fix them and submit PR later.