You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.5 KiB

(ns beherbergung.db.import.offer.core
(:require [beherbergung.config.state :refer [env]]
[beherbergung.db.import.offer.helper :refer [update-offers]]
[ :as random]
[ :as lifeline]
[ :as warhelp]))
(defn import! []
(if-not (:import-ngo env)
(println "No IMPORT_NGO defined")
(let [table (if-not (:import-file env)
(case (:import-ngo env)
(lifeline/importfile->table (:import-file env))
(warhelp/importfile->table (:import-file env))
(println "Records to be imported:" (count table))
(update-offers (:import-ngo env) table)
(println "import finished :)"))))
(require '[beherbergung.db.state :refer [db_ctx]])
(let [ngo:id "warhelp_beherbergung"
{:keys [q_unary]} db_ctx]
(->> (q_unary '{:find [(pull ?e [*])]
:where [[?e :xt/spec :beherbergung.model.offer/record]
[?e ngo:id]]
:in [ngo:id]}
#_(map :id_tmp))))