Created
November 4, 2017 17:19
-
-
Save swlkr/537fa0df1355f9c75e6d9d8dcbc0075a 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
(ns your-project.models.items | |
(:require [oksql.core :as oksql]) | |
(:refer-clojure :exclude [update])) | |
(def db {:connection-uri "postgres://localhost:5432/your_project_db"}) | |
(defn create [m] | |
(oksql/insert db :items m)) | |
(defn update [id m] | |
(oksql/update db :items m :items/where {:id id})) | |
(defn delete [id] | |
(oksql/delete db :items :items/where {:id id})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment