Created
April 3, 2014 10:10
-
-
Save jkyamog/9951941 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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