|
|
@ -65,16 +65,18 @@
|
|
|
|
SET p.value = {value},
|
|
|
|
SET p.value = {value},
|
|
|
|
p.created_at = {created_at},
|
|
|
|
p.created_at = {created_at},
|
|
|
|
p.updated_at = {updated_at}")
|
|
|
|
p.updated_at = {updated_at}")
|
|
|
|
(defn create! [user-uuid schema-uuid instance]
|
|
|
|
(defn create! [user-uuid
|
|
|
|
|
|
|
|
schema-uuid
|
|
|
|
|
|
|
|
{:keys [name properties]}]
|
|
|
|
(let [instance-uuid (neo4j/uuid)
|
|
|
|
(let [instance-uuid (neo4j/uuid)
|
|
|
|
now (neo4j/now-str)
|
|
|
|
now (neo4j/now-str)
|
|
|
|
instance-tuple [create-instance
|
|
|
|
instance-tuple [create-instance
|
|
|
|
{:schema_uuid schema-uuid
|
|
|
|
{:schema_uuid schema-uuid
|
|
|
|
:name (:name instance)
|
|
|
|
:name name
|
|
|
|
:uuid instance-uuid
|
|
|
|
:uuid instance-uuid
|
|
|
|
:created_at now
|
|
|
|
:created_at now
|
|
|
|
:user_uuid user-uuid}]
|
|
|
|
:user_uuid user-uuid}]
|
|
|
|
prop-tuples (for [{:keys [attribute value]} (:properties instance)]
|
|
|
|
prop-tuples (for [{:keys [attribute value]} properties]
|
|
|
|
[create-property
|
|
|
|
[create-property
|
|
|
|
{:uuid instance-uuid
|
|
|
|
{:uuid instance-uuid
|
|
|
|
:attr_uuid (:uuid attribute)
|
|
|
|
:attr_uuid (:uuid attribute)
|
|
|
|