Setting up initial company setup.
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
(ns auto-ap.db.companies)
|
||||
(ns auto-ap.db.companies
|
||||
(:require [clojure.java.jdbc :as j]
|
||||
[auto-ap.db.utils :refer [clj->db db->clj get-conn]]
|
||||
[clojure.edn :as edn]))
|
||||
|
||||
(defn get-all []
|
||||
[{:name "Campbell Brewing Company"
|
||||
:matches ["campbell brewing company" "campbell brewery company" "campbell brewing"]}
|
||||
{:name "Brown Chicken Brown Cow"
|
||||
:matches ["brown chicken brown cow"]}
|
||||
{:name "Naschmarkt Restaurant"
|
||||
:matches ["naschmarkt" "naschmarkt restaurant"]}])
|
||||
(->> (j/query (get-conn) "SELECT * FROM companies")
|
||||
(map db->clj )
|
||||
(map (fn [{:keys [data] :as x}]
|
||||
(merge x (edn/read-string data))))))
|
||||
|
||||
Reference in New Issue
Block a user