Skip to content

Instantly share code, notes, and snippets.

@bitemyapp
Created February 17, 2013 07:32
Show Gist options
  • Save bitemyapp/4970550 to your computer and use it in GitHub Desktop.
Save bitemyapp/4970550 to your computer and use it in GitHub Desktop.
convert db uri for korma
(defn- convert-db-uri [db-uri]
(let [[_ user password host port db] (re-matches #"postgres://(?:(.+):(.*)@)?([^:]+)(?::(\d+))?/(.+)" db-uri)]
{:user user
:password password
:host host
:port (or port 80)
:db db}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment