Source

htsql / doc / ref / functions.rst

Diff from to

doc/ref/functions.rst

    :cut: 3
 
    /department^avg_credits {avg_credits, count(department)}
-    :where(department.avg_credits := avg(course.credits) :trunc(1))
+    :given(department.avg_credits := avg(course.credits) :trunc(1))
 
 
 String Functions
    /{date($dt), time($dt),
      year($d), month($d), day($d),
      hour($t), minute($t), second($t)}
-    :where ($d := date('2010-04-15'),
+    :given ($d := date('2010-04-15'),
             $t := time('20:13'),
             $dt := datetime($d,$t))
 
    /{exists(astro_course.credits>=5),
      every(astro_course.credits>=5),
      count(astro_course.credits>=5)}
-    :where astro_course := course?department.code='astro'
+    :given astro_course := course?department.code='astro'
 
 .. htsql:: /course?department.code='pia'
 
    /{exists(pia_course.credits>=5),
      every(pia_course.credits>=5),
      count(pia_course.credits>=5)}
-    :where pia_course := course?department.code='pia'
+    :given pia_course := course?department.code='pia'
 
 .. index:: min(), max()
 
 .. htsql::
 
    /{min(astro_course.credits), max(astro_course.credits)}
-    :where astro_course := course?department.code='astro'
+    :given astro_course := course?department.code='astro'
 
 .. htsql::
 
    /{min(pia_course.credits), max(pia_course.credits)}
-    :where pia_course := course?department.code='pia'
+    :given pia_course := course?department.code='pia'
 
 .. index:: sum(), avg()
 
 .. htsql::
 
    /{sum(astro_course.credits), avg(astro_course.credits)}
-    :where astro_course := course?department.code='astro'
+    :given astro_course := course?department.code='astro'
 
 .. htsql::
 
    /{sum(pia_course.credits), avg(pia_course.credits)}
-    :where pia_course := course?department.code='pia'
+    :given pia_course := course?department.code='pia'
 
 
 Flow Operations
 | `define(x:=...)`     | add names to the current  | |define-in|               |
 |                      | scope                     |                           |
 +----------------------+---------------------------+---------------------------+
-| `where(expr,x:=...)` | evaluate an expression    | |where-in|                |
+| `given(expr,x:=...)` | evaluate an expression    | |given-in|                |
 |                      | with extra names in the   |                           |
 |                      | current scope             |                           |
 +----------------------+---------------------------+---------------------------+
 +----------------------+---------------------------+---------------------------+
 
 .. |define-in| replace:: ``define(num_prog:=count(program))``
-.. |where-in| replace:: ``count(course?credits>$c) :where $c:=avg(course.credits)``
+.. |given-in| replace:: ``count(course?credits>$c) :given $c:=avg(course.credits)``
 
-.. index:: define(), where()
+.. index:: define(), given()
 
 Calculated Attributes
 ---------------------
 
 `define(x:=...)`
     Add a calculated attribute to the current scope.
-`where(expr,x:=...)`
+`given(expr,x:=...)`
     Evaluate an expression in a current scope with a calculated
     attribute.
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.