Fix dumb message name; allow numbers and underscores in database names
[hcoop/domtool2.git] / src / dbms.sml
index 6f7bb9d..8c34f8b 100644 (file)
@@ -22,7 +22,14 @@ structure Dbms :> DBMS = struct
 
 open DataStructures
 
-type handler = {adduser : string -> string option}
+val validDbname = CharVector.all (fn ch => Char.isAlphaNum ch orelse ch = #"_")
+
+type handler = {getpass : (unit -> Client.passwd_result) option,
+               adduser : {user : string, passwd : string option} -> string option,
+               passwd : {user : string, passwd : string} -> string option,
+               createdb : {user : string, dbname : string} -> string option,
+               dropdb : {user : string, dbname : string} -> string option,
+               grant : {user : string, dbname : string} -> string option}
               
 val dbmses : handler StringMap.map ref = ref StringMap.empty