Adding database dropping to dbtool
[hcoop/domtool2.git] / src / plugins / mysql.sml
index dae75cc..7f55e5f 100644 (file)
@@ -53,9 +53,16 @@ fun createdb {user, dbname} =
     else
        SOME "Error executing CREATE DATABASE script"
 
+fun dropdb {user, dbname} =
+    if Slave.shell [Config.MySQL.dropdb, user, " ", dbname] then
+       NONE
+    else
+       SOME "Error executing DROP DATABASE script"
+
 val _ = Dbms.register ("mysql", {getpass = SOME Client.getpass,
                                 adduser = adduser,
                                 passwd = passwd,
-                                createdb = createdb})
+                                createdb = createdb,
+                                dropdb = dropdb})
 
 end