X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql.lisp;h=1630562e6830b59fd8d3d9a150487726f6886493;hb=cd3df5cb167a754ef0d2f9cb21afeb821528f266;hp=42b30802cd6fc8e9aa535a9b70edf3d472c6ad0e;hpb=f894817b99c5b9624ebb7a0388f415ace23b8ce5;p=umlisp.git diff --git a/sql.lisp b/sql.lisp index 42b3080..1630562 100644 --- a/sql.lisp +++ b/sql.lisp @@ -8,7 +8,7 @@ ;;;; Created: Apr 2000 ;;;; ;;;; This file, part of UMLisp, is -;;;; Copyright (c) 2000-2010 by Kevin M. Rosenberg, M.D. +;;;; Copyright (c) 2000-2012 by Kevin M. Rosenberg, M.D. ;;;; ;;;; UMLisp users are granted the rights to distribute and use this software ;;;; as governed by the terms of the GNU General Public License. @@ -16,12 +16,14 @@ (in-package #:umlisp) -(defvar +umls-sql-map+ +(defparameter +umls-sql-map+ '((:2004aa . "KUMLS2004AA") (:2006ac . "KUMLS2006AC") (:2006ad . "MTS2006AD") - (:2009ab . "MTS2009AB"))) -(defvar +default-umls-db+ "MTS2009AB") + (:2009ab . "MTS2009AB") + (:2010aa . "MTS2010AA") + (:2012ab . "MTS2012AB"))) +(defvar +default-umls-db+ "MTS2012AA_ALL") (defun lookup-db-name (db) (cdr (assoc (ensure-keyword db) +umls-sql-map+))) @@ -69,16 +71,18 @@ (if (eql *umls-sql-type* :mysql) (list *umls-sql-host* *umls-sql-db* *umls-sql-user* *umls-sql-passwd* - nil '((:local-infile . 1))) + nil '((:local-infile . 1)) + ) (list *umls-sql-host* *umls-sql-db* *umls-sql-user* *umls-sql-passwd*))) (defun sql-connect () "Connect to UMLS database, automatically used pooled connections" - (clsql:connect (umls-connection-spec) - :database-type *umls-sql-type* - :encoding :utf-8 - :pool t)) + (let ((db (clsql:connect (umls-connection-spec) + :database-type *umls-sql-type* + :encoding :utf-8 + :pool t))) + db)) (defun sql-disconnect (conn) "Disconnect from UMLS database, but put connection back into pool"