X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=base%2Fdatabase.lisp;h=f3c72b65a2ead44ab85a414296ee959cbad6d2cb;hb=f716bb1161cf9e89a96945c4a444244f9d303691;hp=1e64fb3588d388c814fc9ad7514ea69f9c2de523;hpb=ef075568ce95ff8698ab67ac44665a00e54d1b32;p=clsql.git diff --git a/base/database.lisp b/base/database.lisp index 1e64fb3..f3c72b6 100644 --- a/base/database.lisp +++ b/base/database.lisp @@ -85,6 +85,9 @@ to the new connection, otherwise *default-database is not changed. If pool is t the connection will be taken from the general pool, if pool is a conn-pool object the connection will be taken from this pool." + (unless database-type + (error "Must specify a database-type.")) + (when (stringp connection-spec) (setq connection-spec (string-to-list-connection-spec connection-spec))) @@ -246,6 +249,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