             [ragtime.repl :refer [migrate rollback]]
             [clojure.repl :refer [doc]]
             [honeysql.core :as sql]
-            [honeysql.helpers :refer :all]
+            [honeysql.helpers :refer [insert-into values limit where from select join]]
             [honeysql-postgres.format :refer :all]
-            [honeysql-postgres.helpers :refer :all]
+            [honeysql-postgres.helpers :refer [upsert do-nothing on-conflict do-update-set]]
             [clojure.java.jdbc :as j]
             [tictag.crypto :as crypto]
             [environ.core :refer [env]]
-            [figwheel-sidecar.repl-api]))
+            [figwheel-sidecar.repl-api]
+            [instaparse.core :as insta]))
+
 
 (defn cljs-repl []
   (do (figwheel-sidecar.repl-api/stop-figwheel!)

  (j/with-db-transaction [tx (-> system :db :db)]
    (j/execute! tx
                (-> (insert-into :users)
                    (values [{:username "TEST_USER"
                              :email    "tictag-test@agh.io"
                              :pass     (db/hashp "foobar")
                              :tz       "America/Los_Angeles"}])
                    (upsert (-> (on-conflict :username)
                                (do-nothing)))

                    (upsert (-> (on-conflict :beeminder_id :goal)
                                (do-nothing)))
                    sql/format))))

(def p (insta/parser (clojure.java.io/resource "parser.bnf")))
(defn e [v] (evaluate {:db (:db system) :user (dev-user)} v))

