r8821: integrate usql support
[clsql.git] / sql / functional.lisp
index 125bb71e2f12acddbc49a470cec006cf7ff103f2..dd8aa04c8e581f58b1bbbbc1c8f86f87515532f0 100644 (file)
@@ -2,13 +2,13 @@
 ;;;; *************************************************************************
 ;;;; FILE IDENTIFICATION
 ;;;;
-;;;; Name:          functional.cl
+;;;; Name:          functional.lisp
 ;;;; Purpose:       Functional interface
 ;;;; Programmer:    Pierre R. Mai
 ;;;;
 ;;;; Copyright (c) 1999-2001 Pierre R. Mai
 ;;;;
-;;;; $Id: functional.lisp,v 1.1 2002/09/30 10:19:23 kevin Exp $
+;;;; $Id$
 ;;;;
 ;;;; This file is part of CLSQL. 
 ;;;;
@@ -26,8 +26,7 @@
 ;;;; 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 ;;;; *************************************************************************
 
-(declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
-(in-package :clsql-sys)
+(in-package #:clsql-sys)
 
 
 ;;;; This file implements the more advanced functions of the
               where)
       :database database))))
 
-(defmacro with-database ((db-var connection-spec &rest connect-args) &body body)
-  "Evaluate the body in an environment, where `db-var' is bound to the
-database connection given by `connection-spec' and `connect-args'.
-The connection is automatically closed or released to the pool on exit from the body."
-  (let ((result (gensym "result-")))
-    (unless db-var (setf db-var '*default-database*))
-    `(let ((,db-var (connect ,connection-spec ,@connect-args))
-          (,result nil))
-      (unwind-protect
-          (let ((,db-var ,db-var))
-            (setf ,result (progn ,@body)))
-       (disconnect :database ,db-var))
-      ,result)))
\ No newline at end of file