comparison lib/basis.lig @ 243:2b9dfaffb008

Transactions and queries, at source level
author Adam Chlipala <adamc@hcoop.net>
date Thu, 28 Aug 2008 14:48:33 -0400
parents f5732dc1316c
children
comparison
equal deleted inserted replaced
242:cc193f680193 243:2b9dfaffb008
142 val sql_maxable_int : sql_maxable int 142 val sql_maxable_int : sql_maxable int
143 val sql_maxable_float : sql_maxable float 143 val sql_maxable_float : sql_maxable float
144 val sql_maxable_string : sql_maxable string 144 val sql_maxable_string : sql_maxable string
145 val sql_max : t ::: Type -> sql_maxable t -> sql_aggregate t 145 val sql_max : t ::: Type -> sql_maxable t -> sql_aggregate t
146 val sql_min : t ::: Type -> sql_maxable t -> sql_aggregate t 146 val sql_min : t ::: Type -> sql_maxable t -> sql_aggregate t
147
148
149 (*** Executing queries *)
150
151 con transaction :: Type -> Type
152 val return : t ::: Type
153 -> t -> transaction t
154 val bind : t1 ::: Type -> t2 ::: Type
155 -> transaction t1 -> (t1 -> transaction t2)
156 -> transaction t2
157
158 val query : tables ::: {{Type}} -> exps ::: {Type}
159 -> sql_query tables exps
160 -> state ::: Type
161 -> ($(fold (fn nm (fields :: {Type}) acc => [nm] ~ acc => [nm = $fields] ++ acc) [] tables)
162 -> $exps
163 -> state
164 -> transaction state)
165 -> state
166 -> transaction state
147 167
148 168
149 (** XML *) 169 (** XML *)
150 170
151 con tag :: {Type} -> {Unit} -> {Unit} -> {Type} -> {Type} -> Type 171 con tag :: {Type} -> {Unit} -> {Unit} -> {Type} -> {Type} -> Type