Skip to content

Instantly share code, notes, and snippets.

@MichaelBlume
Created December 2, 2015 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MichaelBlume/b108fbe1813f64cd58d4 to your computer and use it in GitHub Desktop.
Save MichaelBlume/b108fbe1813f64cd58d4 to your computer and use it in GitHub Desktop.
(ns honeysql.extensions.returning
(:require
[honeysql.format :as f]
[honeysql.helpers :as h]))
(defmethod f/format-clause :returning [[_ fields] _]
(str "RETURNING " (f/comma-join (map f/to-sql fields))))
(f/register-clause! :returning 225)
(h/defhelper returning [m fields]
(assoc m :returning (h/collify fields)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment