X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=db-postgresql-socket%2Fpostgresql-socket-sql.lisp;h=c304db07e1204c861cdb86c941224ae21d506e6d;hp=9a2f02d04b60d843defdbae8ba9b298c8bc3c8e7;hb=72c5d9d0555b01290409dc2607935db823fa1f10;hpb=a443a60adefa64f590d2803e85c7e4657e806225 diff --git a/db-postgresql-socket/postgresql-socket-sql.lisp b/db-postgresql-socket/postgresql-socket-sql.lisp index 9a2f02d..c304db0 100644 --- a/db-postgresql-socket/postgresql-socket-sql.lisp +++ b/db-postgresql-socket/postgresql-socket-sql.lisp @@ -430,16 +430,20 @@ doesn't depend on UFFI." (defmethod database-create (connection-spec (type (eql :postgresql-socket))) - (error 'clsql-access-error - :connection-spec connection-spec - :database-type type - :error "Unable to create databases on a socket connection.")) + (destructuring-bind (host name user password) connection-spec + (let ((database (database-connect (list host "template1" user password) + type))) + (unwind-protect + (execute-command (format nil "create database ~A" name)) + (database-disconnect database))))) (defmethod database-destroy (connection-spec (type (eql :postgresql-socket))) - (error 'clsql-access-error - :connection-spec connection-spec - :database-type type - :error "Unable to create databases on a socket connection.")) + (destructuring-bind (host name user password) connection-spec + (let ((database (database-connect (list host "template1" user password) + type))) + (unwind-protect + (execute-command (format nil "drop database ~A" name)) + (database-disconnect database))))) (defmethod database-probe (connection-spec (type (eql :postgresql-socket))) (destructuring-bind (host name user password) connection-spec