X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=connect.lisp;h=d1b3789c91e609cbbce24d459e461a1e2b079c5d;hb=4675e305339bd8b9f4cc15eb5f2da6036907a301;hp=434a4f4e0591b494b27aca0fccca7c5dbd4f7499;hpb=d7f427eeebf7e6404ad2d1ebabbc8ebaa064898c;p=hyperobject.git diff --git a/connect.lisp b/connect.lisp index 434a4f4..d1b3789 100644 --- a/connect.lisp +++ b/connect.lisp @@ -7,15 +7,15 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Apr 2000 ;;;; -;;;; $Id: connect.lisp,v 1.1 2002/12/01 21:07:28 kevin Exp $ +;;;; $Id: connect.lisp,v 1.2 2002/12/02 15:57:17 kevin Exp $ ;;;; ;;;; This file, part of Hyperobject-SQL, is ;;;; Copyright (c) 2000-2002 by Kevin M. Rosenberg, M.D. ;;;; ************************************************************************* (in-package :hyperobject) -(declaim (optimize (speed 3) (safety 1) (compilation-speed 0) (debug 3))) - +(eval-when (:compile-toplevel :execute) + (declaim (optimize (speed 2) (safety 2) (compilation-speed 0) (debug 2)))) (defvar *ho-sql-db* "ho") (defun ho-sql-db () @@ -70,22 +70,12 @@ (progn ,@body) (when ,conn (clsql:disconnect :database ,conn))))) -(defun sql (stmt conn) - (if (string-equal "SELECT" (subseq stmt 0 6)) - (sql-query stmt conn) - (sql-execute stmt conn))) - (defun sql-query (cmd conn &key (types :auto)) (clsql:query cmd :database conn :types types)) (defun sql-execute (cmd conn) (clsql:execute-command cmd :database conn)) -(defun ho-sql (stmt) - (check-type stmt string) - (with-sql-connection (conn) - (sql stmt conn))) - ;;; Pool of open connections (defmacro with-mutex-sql ((conn) &body body)