Created
February 17, 2013 07:32
-
-
Save bitemyapp/4970550 to your computer and use it in GitHub Desktop.
convert db uri for korma
This file contains 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
(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