summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-08-28 14:48:33 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-08-28 14:48:33 -0400
commit508290e29047e068b9db4b02485fefd9e3ced81c (patch)
treed3fc8eec392562fbb5c15d431c4b7e3ff8d6a824 /lib
parent6cc9b62f90276ce8535ead07a3865cd71d98a526 (diff)
Transactions and queries, at source level
Diffstat (limited to 'lib')
-rw-r--r--lib/basis.lig20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/basis.lig b/lib/basis.lig
index f14a9233..f9fc23d5 100644
--- a/lib/basis.lig
+++ b/lib/basis.lig
@@ -146,6 +146,26 @@ val sql_max : t ::: Type -> sql_maxable t -> sql_aggregate t
val sql_min : t ::: Type -> sql_maxable t -> sql_aggregate t
+(*** Executing queries *)
+
+con transaction :: Type -> Type
+val return : t ::: Type
+ -> t -> transaction t
+val bind : t1 ::: Type -> t2 ::: Type
+ -> transaction t1 -> (t1 -> transaction t2)
+ -> transaction t2
+
+val query : tables ::: {{Type}} -> exps ::: {Type}
+ -> sql_query tables exps
+ -> state ::: Type
+ -> ($(fold (fn nm (fields :: {Type}) acc => [nm] ~ acc => [nm = $fields] ++ acc) [] tables)
+ -> $exps
+ -> state
+ -> transaction state)
+ -> state
+ -> transaction state
+
+
(** XML *)
con tag :: {Type} -> {Unit} -> {Unit} -> {Type} -> {Type} -> Type