summaryrefslogtreecommitdiff
path: root/lib/ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-04-28 14:02:23 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-04-28 14:02:23 -0400
commitcaf010bca085bea65037d194c3eb21ca8b83c23b (patch)
tree97c50c49b7e1358f4cc22a2d9adf9f6d4b911353 /lib/ur
parent19b1fab19ef9a3931f21b6f5c3472db4191caf96 (diff)
Preparing to allow views in SELECT FROM clauses
Diffstat (limited to 'lib/ur')
-rw-r--r--lib/ur/basis.urs13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/ur/basis.urs b/lib/ur/basis.urs
index c80dde7c..ec31e57f 100644
--- a/lib/ur/basis.urs
+++ b/lib/ur/basis.urs
@@ -124,6 +124,13 @@ val self : transaction client
(** SQL *)
con sql_table :: {Type} -> {{Unit}} -> Type
+con sql_view :: {Type} -> Type
+
+class fieldsOf :: Type -> {Type} -> Type
+val fieldsOf_table : fs ::: {Type} -> keys ::: {{Unit}}
+ -> fieldsOf (sql_table fs keys) fs
+val fieldsOf_view : fs ::: {Type}
+ -> fieldsOf (sql_view fs) fs
(*** Constraints *)
@@ -222,9 +229,9 @@ val sql_subset_all : tables :: {{Type}} -> sql_subset tables tables
con sql_from_items :: {{Type}} -> Type
-val sql_from_table : cols ::: {Type} -> keys ::: {{Unit}}
- -> name :: Name -> sql_table cols keys
- -> sql_from_items [name = cols]
+val sql_from_table : t ::: Type -> fs ::: {Type}
+ -> fieldsOf t fs -> name :: Name
+ -> t -> sql_from_items [name = fs]
val sql_from_comma : tabs1 ::: {{Type}} -> tabs2 ::: {{Type}}
-> [tabs1 ~ tabs2]
=> sql_from_items tabs1 -> sql_from_items tabs2