Skip to content

Instantly share code, notes, and snippets.

@jkyamog
Created April 3, 2014 10:10
Show Gist options
  • Save jkyamog/9951941 to your computer and use it in GitHub Desktop.
Save jkyamog/9951941 to your computer and use it in GitHub Desktop.
(defentity products)
(defn get-products []
(select products))
(defn create-product [product]
(insert products (values product)))
(defn retrieve-product [id]
(select products
(where {:id (Integer/parseInt id)})))
(defn update-product [id product]
(update products
(set-fields product)
(where {:id (Integer/parseInt id)})))
(defn delete-product [id]
(delete products
(where {:id (Integer/parseInt id)})))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment