on master help sign in
More todos
commit6289f0dab4d7afc6c1e5b984678c7765f46b8d20 authorOliver Charles <ollie@ocharles.org.uk> dateSun 4 Apr 2021, 20:30 (6 years ago) parentfb4e1a5
2 files changed+60−1
docs/concepts/queries.rst+59 docs/index.rst+1−1
docs/concepts/queries.rst+59
@@ -94,3 +94,62 @@ have to introduce functions. Expanding on the latter query, we could write::
9494Now we have a query that, for each ``User``, fetches all orders for that user.
9595The final ``return`` means that for each ``User`` and ``Order``, we'll return a
9696single row.
97+
98+Selecting rows from tables
99+--------------------------
100+
101+With the more theoretical side of ``Query`` considered, we can start looking at
102+the more pragmatic side, and how ``Query`` can express some common SQL idioms.
103+
104+First, one of the most common operations is to select all rows from a *base
105+table*. In SQL, this is a ``SELECT * FROM x`` query, and in Rel8 we use ``each``
106+with a ``TableSchema``.
107+
108+Limit and offset
109+----------------
110+
111+.. todo::
112+
113+ Write this
114+
115+Filtering queries
116+-----------------
117+
118+.. todo::
119+
120+ Write this
121+
122+Inner joins
123+-----------
124+
125+.. todo::
126+
127+ Write this
128+
129+Left (outer) joins with ``optional``
130+------------------------------------
131+
132+.. todo::
133+
134+ Write this
135+
136+Ordering results
137+----------------
138+
139+.. todo::
140+
141+ Write this
142+
143+Aggregating queries
144+-------------------
145+
146+.. todo::
147+
148+ Write this
149+
150+Set operations
151+--------------
152+
153+.. todo::
154+
155+ Write this
docs/index.rst+1−1
@@ -24,7 +24,7 @@ The main objectives of Rel8 are:
2424
2525.. toctree::
2626 :caption: Rel8 concepts
27− :maxdepth: 1
27+ :maxdepth: 2
2828
2929 concepts/dbtype
3030 concepts/expr