<commit_before>(ns ruuvi-server.heroku.config
  (:import java.net.URI)
  (:use korma.db)
  (:use ruuvi-server.database)
  )

(def *database-config*
  ;; Heroku DATABASE_URL looks like this:
  ;; postgres://username:password@some.host.at.amazonaws.com/databasename
  (let [uri (URI. (System/getenv "DATABASE_URL"))
        splitted-userinfo (.split (.getUserInfo uri) ":")]
        {:classname "org.postgresql.Driver"
         :subprotocol "postgresql"
         :user (nth splitted-userinfo 0)
         :password (nth splitted-userinfo 1)
         :subname (str "//" (.getHost uri) (.getPath uri))
         }))

(def *server-port* (Integer/parseInt (System/getenv "PORT")))

(defdb db (postgres (create-connection-pool *database-config*)))<commit_msg>logging level changes<commit_after>(ns ruuvi-server.heroku.config
  (:import java.net.URI)
  (:use korma.db)
  (:use ruuvi-server.database)
  )

(def *database-config*
  ;; Heroku DATABASE_URL looks like this:
  ;; postgres://username:password@some.host.at.amazonaws.com/databasename
  (let [uri (URI. (System/getenv "DATABASE_URL"))
        splitted-userinfo (.split (.getUserInfo uri) ":")]
        {:classname "org.postgresql.Driver"
         :subprotocol "postgresql"
         :user (nth splitted-userinfo 0)
         :password (nth splitted-userinfo 1)
         :subname (str "//" (.getHost uri) (.getPath uri))
         }))

(def *server-port* (Integer/parseInt (System/getenv "PORT")))

(defdb db (postgres *database-config*))
{'fraction_non_alphanumeric': 0.15778826702629806, 'fraction_numerical': 0.0026972353337828725, 'mean_word_length': 3.3391812865497075, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2745038', 'n_tokens_mistral': 539, 'n_tokens_neox': 514, 'n_words': 106}