HCoop
/
hcoop
/
domtool2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Specifying encoding on database creation
[hcoop/domtool2.git]
/
src
/
dbms.sml
diff --git
a/src/dbms.sml
b/src/dbms.sml
index
fd04fd7
..
71fb664
100644
(file)
--- a/
src/dbms.sml
+++ b/
src/dbms.sml
@@
-22,12
+22,18
@@
structure Dbms :> DBMS = struct
open DataStructures
open DataStructures
-val validDbname = CharVector.all Char.isAlpha
+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,
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}
val dbmses : handler StringMap.map ref = ref StringMap.empty
val dbmses : handler StringMap.map ref = ref StringMap.empty