           channel-id (Integer/parseInt (:channel-id params))
           thread-id (Integer/parseInt (:thread-id params))]
       (get-messages channel-id thread-id))))
-
-(defn add-msg [channel-id thread-id msg]
-  (korma/insert messages
-    (korma/values {:channel_id channel-id
-                   :thread_id thread-id
-                   :message msg})))
 
 (defn chat-thread-ws-handler [ch request]
   (let [params (:route-params request)

                                   :password "postgres"}))

  (korma/defentity channels
    (korma/table :channels)
    (korma/transform
      (fn [c] (-> c
                  (assoc :app :chat)

                  (clojure.set/rename-keys {:id :channel-id})))))

  (korma/defentity threads
    (korma/transform
      (fn [t] (clojure.set/rename-keys t {:id :thread-id
                                          :channel_id :channel-id}))))

  (korma/defentity messages
    (korma/transform
      (fn [m] (-> m
                  (clojure.set/rename-keys {:id :message-id
