[postmodern-devel] with-connection problem

Rafał Strzaliński nablaone at gmail.com
Sun Aug 19 07:38:42 UTC 2007


On 8/17/07, Ryszard Szopa <ryszard.szopa at gmail.com> wrote:
>
> This approach make also a lot easier writing custom with-*-connection
> macros (like with-object-connection and so on).
>
> Marijn: maybe you could consider changing Postmodern's with-connection
> as I've described above?

or to something like this one:

(defvar *connection-spec* (list "db" "user" "pass" "host" :pooled-p t))

(defmacro with-db (&body body)
  `(let ((*database* (apply 'connect *connection-spec*)))
    (unwind-protect (progn , at body)
      (disconnect *database*))))



-- 
Cheers,
Rafal Strzalinski (nabla)
http://nablaone.net



More information about the postmodern-devel mailing list