 (defmethod get-table :project [_] "projects")
 (defmethod get-table :property [_] "entities")
 (defmethod get-table :entity [_] "entities")
+(defmethod get-table :profile [_] "profiles")
 (defmethod get-table :device [_] "devices")
 (defmethod get-table :sensor [_] "sensors")
 (defmethod get-table :sensor-metadata [_] "sensor_metadata")

  (update! [_ typ payload where]
    (assert where "No where clause")
    (alia/execute session
     (hayt/update (get-table typ) 
                  (hayt/set-columns (cassandraify payload))
                  (hayt/where (cassandraify-v where)))))


(defmethod gen-key :project [typ payload] ((sha1-keyfn :name :programme-id) payload))
(defmethod gen-key :entity [typ payload] ((sha1-keyfn :property-code :project-id) payload))
(defmethod gen-key :device [typ payload] ((sha1-keyfn :description :entity-id) payload))
(defmethod gen-key :profile [typ payload] ((sha1-keyfn :timestamp :entity-id) payload))

(defmethod gen-key :sensor [typ payload] nil)
(defmethod gen-key :sensor-metadata [typ payload] nil)
