Created
November 4, 2017 17:15
-
-
Save swlkr/78afde158ab28aa18d5a6588b188ce96 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"}) | |
(def query (partial oksql/query db)) | |
(defn create [m] | |
(query :items/insert m)) | |
(defn update [id m] | |
(query :items/update (merge {:id id} m))) | |
(defn delete [id] | |
(query :items/delete {:id id})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment