X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=base%2Fdatabase.lisp;h=cc26d7119c517449b603ed41b654adeec3594017;hb=dd0b244d779d96f80e262e02ce4d2f793888b79f;hp=62c6077d313ac7684e8debfd7b209da31a7d6b89;hpb=29c15e4e9cf9cbb5ccfe33c0af59a24d0614bef9;p=clsql.git diff --git a/base/database.lisp b/base/database.lisp index 62c6077..cc26d71 100644 --- a/base/database.lisp +++ b/base/database.lisp @@ -181,7 +181,7 @@ if the database connection has been lost." ((or string list) (let ((db (find-database database :errorp nil))) (when (null db) - (if (and database errorp) + (if (and database error) (error 'clsql-generic-error :message (format nil "Unable to find database with connection-spec ~A." database)) @@ -190,8 +190,8 @@ if the database connection has been lost." (when (is-database-open db) (if force - (ignore-errors (disconnect db)) - (disconnect db :error nil))) + (ignore-errors (disconnect :database db)) + (disconnect :database db :error nil))) (connect (connection-spec db)))) @@ -246,6 +246,10 @@ of full is NIL." (setq connection-spec (string-to-list-connection-spec connection-spec))) (database-destroy connection-spec database-type)) +(defun list-databases (connection-spec &key database-type) + (when (stringp connection-spec) + (setq connection-spec (string-to-list-connection-spec connection-spec))) + (database-list connection-spec database-type)) (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