-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
47 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -821,7 +821,8 @@ <h2 id="object"><a class="header" href="#object">OBJECT</a></h2> | |
<h2 id="dynamic-literals"><a class="header" href="#dynamic-literals">Dynamic Literals</a></h2> | ||
<h3 id="row-literals"><a class="header" href="#row-literals">Row Literals</a></h3> | ||
<p>It is possible return an entire document (row) as a single literal value. | ||
The syntax is akin to Postgres <a href="https://www.postgresql.org/docs/current/rowtypes.html"><code>ROW</code> literals</a>. | ||
The syntax is akin to Postgres | ||
<a href="https://www.postgresql.org/docs/current/rowtypes.html"><code>ROW</code> literals</a>. | ||
Unlike <code>table.*</code>, which pads non-existent columns with <code>NULL</code>, | ||
a row literal returns exactly the schema specified for each individual row.</p> | ||
<ul> | ||
|
@@ -830,6 +831,17 @@ <h3 id="row-literals"><a class="header" href="#row-literals">Row Literals</a></h | |
<p>Example usage:</p> | ||
<pre><code class="language-sql">SELECT { products.* } FROM products; | ||
</code></pre> | ||
<p>As a shorthand, a table's name may be used in the <code>SELECT</code> clause to return | ||
entire rows as documents:</p> | ||
<pre><code class="language-sql">-> SELECT users FROM users; | ||
-- [{'users': {'email': '[email protected]', 'name': 'Patrick'}}, | ||
-- {'users': {'email': '[email protected]', 'name': 'Preethi'}}] | ||
</code></pre> | ||
<p>NOTE: When a table contains a column of the same name, the column takes precedence | ||
and a single column is returned, as usual:</p> | ||
<pre><code class="language-sql">-> SELECT status FROM status; | ||
-- [{'status': 'error'}, {'status': 'ok'}] | ||
</code></pre> | ||
<h3 id="spread"><a class="header" href="#spread">Spread</a></h3> | ||
<p>The Spread Operator (<code>...</code>, sometimes known as "splat") | ||
can be used to directly flatten/unnest one collection | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -297,7 +297,8 @@ <h2 id="object"><a class="header" href="#object">OBJECT</a></h2> | |
<h2 id="dynamic-literals"><a class="header" href="#dynamic-literals">Dynamic Literals</a></h2> | ||
<h3 id="row-literals"><a class="header" href="#row-literals">Row Literals</a></h3> | ||
<p>It is possible return an entire document (row) as a single literal value. | ||
The syntax is akin to Postgres <a href="https://www.postgresql.org/docs/current/rowtypes.html"><code>ROW</code> literals</a>. | ||
The syntax is akin to Postgres | ||
<a href="https://www.postgresql.org/docs/current/rowtypes.html"><code>ROW</code> literals</a>. | ||
Unlike <code>table.*</code>, which pads non-existent columns with <code>NULL</code>, | ||
a row literal returns exactly the schema specified for each individual row.</p> | ||
<ul> | ||
|
@@ -306,6 +307,17 @@ <h3 id="row-literals"><a class="header" href="#row-literals">Row Literals</a></h | |
<p>Example usage:</p> | ||
<pre><code class="language-sql">SELECT { products.* } FROM products; | ||
</code></pre> | ||
<p>As a shorthand, a table's name may be used in the <code>SELECT</code> clause to return | ||
entire rows as documents:</p> | ||
<pre><code class="language-sql">-> SELECT users FROM users; | ||
-- [{'users': {'email': '[email protected]', 'name': 'Patrick'}}, | ||
-- {'users': {'email': '[email protected]', 'name': 'Preethi'}}] | ||
</code></pre> | ||
<p>NOTE: When a table contains a column of the same name, the column takes precedence | ||
and a single column is returned, as usual:</p> | ||
<pre><code class="language-sql">-> SELECT status FROM status; | ||
-- [{'status': 'error'}, {'status': 'ok'}] | ||
</code></pre> | ||
<h3 id="spread"><a class="header" href="#spread">Spread</a></h3> | ||
<p>The Spread Operator (<code>...</code>, sometimes known as "splat") | ||
can be used to directly flatten/unnest one collection | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -155,7 +155,8 @@ Object equality is tested by comparing each key-value pair as an array. | |
### Row Literals | ||
|
||
It is possible return an entire document (row) as a single literal value. | ||
The syntax is akin to Postgres [`ROW` literals](https://www.postgresql.org/docs/current/rowtypes.html). | ||
The syntax is akin to Postgres | ||
[`ROW` literals](https://www.postgresql.org/docs/current/rowtypes.html). | ||
Unlike `table.*`, which pads non-existent columns with `NULL`, | ||
a row literal returns exactly the schema specified for each individual row. | ||
|
||
|
@@ -167,6 +168,23 @@ Example usage: | |
SELECT { products.* } FROM products; | ||
``` | ||
|
||
As a shorthand, a table's name may be used in the `SELECT` clause to return | ||
entire rows as documents: | ||
|
||
```sql | ||
-> SELECT users FROM users; | ||
-- [{'users': {'email': '[email protected]', 'name': 'Patrick'}}, | ||
-- {'users': {'email': '[email protected]', 'name': 'Preethi'}}] | ||
``` | ||
|
||
NOTE: When a table contains a column of the same name, the column takes precedence | ||
and a single column is returned, as usual: | ||
|
||
```sql | ||
-> SELECT status FROM status; | ||
-- [{'status': 'error'}, {'status': 'ok'}] | ||
``` | ||
|
||
### Spread | ||
|
||
The Spread Operator (`...`, sometimes known as "splat") | ||
|