On Oct 3, 2008, at 5:13 PM, Tom Emerson wrote:
> Hey folks,
>
> I was using clojure.contrib.sql and found myself needing to create
> connection strings with several parameters, e.g.,
>
> (def *dbcon* (connection "jtds:sqlserver"
> "//dbserver.foo.com/MY_DB;instance=dev;user=tree;password=flubber"))
>
> I modified the connection function to optionally take a map of
> parameters:
>
> (def *dbcon*
> (my-connection "jtds:sqlserver" "//dbserver.foo.com/MY_DB"
> { :instance "dev" :user "tree" :password
> "flubber"}))
Hi Tom,
Thanks very much for the suggestion!
I wrote the code a little differently, but it has a similar effect.
The new version will support either a literal map as in your example:
(def *dbcon*
(my-connection "jtds:sqlserver" "//dbserver.foo.com/MY_DB"
{ :instance "dev" :user "tree" :password "flubber"}))
or inline keywords and values:
(def *dbcon*
(my-connection "jtds:sqlserver" "//dbserver.foo.com/MY_DB"
:instance "dev" :user "tree" :password "flubber"))
Specifying the options as extra baggage on db-name is still supported
as well.
http://clojure-contrib.svn.sourceforge.net/viewvc/clojure-contrib?view=rev&revision=182
Thanks!
--Steve
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---