HCoop
/
hcoop
/
domtool2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
abcfe83
)
Error messages for Postgres dbtool
author
Adam Chlipala
<adamc@hcoop.net>
Thu, 22 Nov 2007 21:45:34 +0000
(21:45 +0000)
committer
Adam Chlipala
<adamc@hcoop.net>
Thu, 22 Nov 2007 21:45:34 +0000
(21:45 +0000)
src/plugins/postgres.sml
patch
|
blob
|
blame
|
history
diff --git
a/src/plugins/postgres.sml
b/src/plugins/postgres.sml
index
09e3a07
..
f80fcea
100644
(file)
--- a/
src/plugins/postgres.sml
+++ b/
src/plugins/postgres.sml
@@
-21,24
+21,18
@@
structure Postgres :> POSTGRES = struct
fun adduser {user, passwd} =
structure Postgres :> POSTGRES = struct
fun adduser {user, passwd} =
- if Slave.shell [Config.Postgres.adduser, user] then
- NONE
- else
- SOME "Error executing CREATE USER script"
+ Option.map (fn s => "Error executing CREATE USER script:\n" ^ s)
+ (Slave.shellOutput [Config.Postgres.adduser, user])
fun passwd _ = SOME "We don't use PostgreSQL passwords."
fun createdb {user, dbname} =
fun passwd _ = SOME "We don't use PostgreSQL passwords."
fun createdb {user, dbname} =
- if Slave.shell [Config.Postgres.createdb, user, " ", dbname] then
- NONE
- else
- SOME "Error executing CREATE DATABASE script"
+ Option.map (fn s => "Error executing CREATE DATABASE script:\n" ^ s)
+ (Slave.shellOutput [Config.Postgres.createdb, user, " ", dbname])
fun dropdb {user, dbname} =
fun dropdb {user, dbname} =
- if Slave.shell [Config.Postgres.dropdb, user, " ", dbname] then
- NONE
- else
- SOME "Error executing DROP DATABASE script"
+ Option.map (fn s => "Error executing DROP DATABASE script:\n" ^ s)
+ (Slave.shellOutput [Config.Postgres.dropdb, user, " ", dbname])
val _ = Dbms.register ("postgres", {getpass = NONE,
adduser = adduser,
val _ = Dbms.register ("postgres", {getpass = NONE,
adduser = adduser,