X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=base%2Fdatabase.lisp;fp=base%2Fdatabase.lisp;h=7cf45f18485702104768a8ba31bd5b30d23a45d6;hb=c4da3cfcbb955395d8a556e1f89aadad696302b7;hp=a7313ebc62fd62b25ea63dcffa6dcea5bada5b18;hpb=afa1e8481ca62ee15952c695fd04c8601b65b218;p=clsql.git diff --git a/base/database.lisp b/base/database.lisp index a7313eb..7cf45f1 100644 --- a/base/database.lisp +++ b/base/database.lisp @@ -206,6 +206,21 @@ of full is NIL." (print-separator total-size)))) (values))) +(defun create-database (connection-spec &key database-type) + (when (stringp connection-spec) + (setq connection-spec (string-to-list-connection-spec connection-spec))) + (database-create connection-spec database-type)) + +(defun probe-database (connection-spec &key database-type) + (when (stringp connection-spec) + (setq connection-spec (string-to-list-connection-spec connection-spec))) + (database-probe connection-spec database-type)) + +(defun destroy-database (connection-spec &key database-type) + (when (stringp connection-spec) + (setq connection-spec (string-to-list-connection-spec connection-spec))) + (database-destory 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 @@ -227,3 +242,4 @@ The connection is automatically closed or released to the pool on exit from the `(progv '(*default-database*) (list ,database) ,@body)) +