        (not-nil?)))
 
 (defn read-config
+  "Reads the config file from the file path given"
   [config-file]
   (json/read-str (slurp config-file) :key-fn keyword))
 
 (defn get-queries
+  "Appends query group name to every query object"
   [query-group]
   (map (fn [query-map]
          (assoc query-map :queryGroupname (get query-group :queryGroupname)))
        (get query-group :queries []))
   )
 
-(defn replace-param [query param-value param-name]
+(defn replace-param
+  "Replace parameter name with parameter value in the SQL query."
+  [query param-value param-name]
   (let [search-param (str ":" param-name ":")
         sql-query (get query :query)]
     (if (is-substring-of search-param sql-query)

        (recur reduced-map (replace-param query param-value param-name))))))

(defn render-queries
  [query-params-map query-list]
  (map (partial render-query query-params-map) query-list))

(defn fire-query
  [data-source query]
  (let [db-spec {:datasource data-source}
        sql-query (get query :query)]
      (assoc query :result (jdbc/db-query-with-resultset db-spec [sql-query] identity))
    ))

(defn run-queries-and-get-results
  [config-file data-source query-params-map]
  (->> (read-config config-file)
       (map get-queries)

(def not-nil? (complement nil?))

(defn is-substring-of
  "Gives back a boolean output whether the first
  string is a substring of the second string or not"
  [sub-string string]
  (->> sub-string
       (re-pattern)
