From 508290e29047e068b9db4b02485fefd9e3ced81c Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 28 Aug 2008 14:48:33 -0400 Subject: Transactions and queries, at source level --- lib/basis.lig | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib') 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 -- cgit v1.2.3