Skip to content

Instantly share code, notes, and snippets.

@senior
Created May 21, 2015 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save senior/47a1c754b1ee9b31b99b to your computer and use it in GitHub Desktop.
Save senior/47a1c754b1ee9b31b99b to your computer and use it in GitHub Desktop.
(defprotocol StorageDifferences
(-munge-uuid-for-storage [driver value])
(-munge-hash-for-storage [driver value])
(-munge-json-for-storage [driver value]))
(extend-protocol StorageDifferences
com.impossibl.postgres.jdbc.PGDataSource
(-munge-uuid-for-storage [driver value]
(str->pgobject "uuid" value))
(-munge-hash-for-storage [driver value]
(str->pgobject "bytea" value))
(-munge-json-for-storage [driver value]
(str->pgobject "json" value)))
(def identity' (fn [_ x] x))
(extend org.hsqldb.jdbc.JDBCDataSource
StorageDifferences
{:-munge-uuid-for-storage identity'
:-munge-hash-for-storage identity'
:-munge-json-for-storage identity'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment