added ability to manually insert transactions

This commit is contained in:
BC
2018-07-12 22:05:14 -07:00
parent 29e0de49e9
commit 085cd17100
8 changed files with 88 additions and 46 deletions

View File

@@ -8,10 +8,13 @@
(defn upsert! [row]
(j/db-do-prepared (get-conn)
(sql/format (-> (helpers/insert-into :transactions)
(helpers/values [row])
(postgres-helpers/upsert (-> (postgres-helpers/on-conflict :id)
(postgres-helpers/do-update-set :post_date :status :check_id)))))))
(doto (sql/format (-> (helpers/insert-into :transactions)
(helpers/values [row])
(postgres-helpers/upsert (-> (postgres-helpers/on-conflict :id)
(postgres-helpers/do-update-set :post_date :status :check_id)
(helpers/where [:<> :EXCLUDED.check_id nil])))))
println)))
(def base-query (sql/build :select :*
:from :transactions))