X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/7adeee333409df08a82fafc8b1629e56d47c09c1..fe789bea628b15229156c8a4272c2b6063c9b1a0:/src/dbms.sml?ds=sidebyside diff --git a/src/dbms.sml b/src/dbms.sml index 8c34f8b..71fb664 100644 --- a/src/dbms.sml +++ b/src/dbms.sml @@ -23,11 +23,15 @@ structure Dbms :> DBMS = struct open DataStructures val validDbname = CharVector.all (fn ch => Char.isAlphaNum ch orelse ch = #"_") +fun validEncoding encoding = + case encoding of + NONE => true + | SOME e => size e > 0 andalso size e < 20 andalso CharVector.all Char.isAlphaNum e 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, + createdb : {user : string, dbname : string, encoding : string option} -> string option, dropdb : {user : string, dbname : string} -> string option, grant : {user : string, dbname : string} -> string option}