Skip to content

Allow korma to specify extra parameters to defdb #373

@mprokopov

Description

@mprokopov

I faced to following issue with local timezone using mysql
http://stackoverflow.com/questions/26515700/mysql-jdbc-driver-5-1-33-time-zone-issue

And I did some workaround for that:

(def db-params (mysql {:host "localhost"
                      :db "itservice"
                      :user "root"}))

(def extra-params {:useLegacyDatetimeCode false
               :serverTimezone "UTC"
               :useSSL false})

(def subparams (->> (map (fn [[k v]] (str (name k) "=" v)) extra-params)
                (clojure.string/join "&")
                (str "?")))
(def new-params (update db-params :subname #(str % subparams)))
(defdb my-db new-params)

so params string should look something like "//localhost:3306/itservice?useLegacyDatetimeCode=false&serverTimezone=UTC&useSSL=false", and there is no support for such extra parameters for db-params.

Metadata

Metadata

Assignees

No one assigned

    Labels

    inactive-issue?This issue should be closed within 2 weeks of the most recent comment due to inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions