mirror of
https://github.com/penpot/penpot.git
synced 2025-06-04 01:51:36 +02:00
✨ Adds system to load initial project data
This commit is contained in:
parent
dfc6ebfeb0
commit
66fe0048a5
5 changed files with 174 additions and 11 deletions
|
@ -186,6 +186,18 @@
|
|||
(sql/insert table params opts)
|
||||
(assoc opts :return-keys true))))
|
||||
|
||||
(defn- select-values [map ks]
|
||||
(reduce #(conj %1 (map %2)) [] ks))
|
||||
|
||||
(defn insert-multi!
|
||||
[ds table param-list]
|
||||
(doseq [params param-list]
|
||||
(insert! ds table params))
|
||||
;; FIXME: Won't work
|
||||
#_(let [keys (->> param-list first keys (into []))
|
||||
params (->> param-list (mapv #(->> keys (select-values %) (into []))) )]
|
||||
(jdbc-sql/insert-multi! ds table keys params default-options)))
|
||||
|
||||
(defn update!
|
||||
([ds table params where] (update! ds table params where nil))
|
||||
([ds table params where opts]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue