<commit_before>(ns word-keeper.db
  (:require [yesql.core :refer [defquery]]))

(def db-spec {:classname "org.postgresql.Driver"
              :subprotocol "postgresql"
              :subname "//localhost:5432/wordkeeper"
              :user "cloudsigma"
              :password "<PASSWORD>"})

(defquery select-english-russian "sql/select-english-russian.sql")
(defquery select-russian-english "sql/select-russian-english.sql")<commit_msg>Ugly db configuration for openshift<commit_after>(ns word-keeper.db
  (:require [yesql.core :refer [defquery]]))

(def db-subname
  (str
    "//"
    (get (System/getenv) "OPENSHIFT_POSTGRESQL_DB_HOST" "localhost")
    ":"
    (get (System/getenv) "OPENSHIFT_POSTGRESQL_DB_PORT" "5432")
    "/"
    (get (System/getenv) "OPENSHIFT_APP_NAME" "wordkeeper")))

(def db-spec {:classname "org.postgresql.Driver"
              :subprotocol "postgresql"
              :subname db-subname
              :user
                (get (System/getenv) "OPENSHIFT_POSTGRESQL_DB_USERNAME" "cloudsigma")
              :password
                (get (System/getenv) "OPENSHIFT_POSTGRESQL_DB_PASSWORD" "<PASSWORD>")})

(defquery select-english-russian "sql/select-english-russian.sql")
(defquery select-russian-english "sql/select-russian-english.sql")
{'fraction_non_alphanumeric': 0.1406127258444619, 'fraction_numerical': 0.006284367635506678, 'mean_word_length': 3.2046204620462047, 'pattern_counts': {'":': 1, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '5966508', 'n_tokens_mistral': 441, 'n_tokens_neox': 441, 'n_words': 72}