docs(website): expand the SQL-echo section; prune over-promised notes
Rewrite "Seeing the SQL behind a command" with the learning framing, a grounded ALTER TABLE example, and the sql-echo cast. Drop the "multiple result tabs" promise (won't-do on main) and the planned `hint`-command note (superseded by the hint panel).
This commit is contained in:
@@ -58,7 +58,30 @@ That runs just this one line as SQL; you stay in simple mode afterwards.
|
|||||||
|
|
||||||
## Seeing the SQL behind a command
|
## Seeing the SQL behind a command
|
||||||
|
|
||||||
When you run a simple-mode command in advanced mode, the playground prints
|
Run a **simple-mode command while in advanced mode** and the playground prints
|
||||||
the equivalent SQL beneath your command. It is a built-in way to learn how
|
the equivalent SQL beneath it, tagged `Executing SQL:`. This is one of the most
|
||||||
the friendly commands map onto real SQL — the same statements you could type
|
useful ways the playground teaches: you write the friendly, readable command,
|
||||||
yourself in advanced mode.
|
and immediately see the real SQL statement it stands for — the same statement
|
||||||
|
you could have typed yourself.
|
||||||
|
|
||||||
|
It turns every command into a small SQL lesson. Add a column the easy way and
|
||||||
|
watch the `ALTER TABLE` it maps to:
|
||||||
|
|
||||||
|
```rdbms
|
||||||
|
add column to books: title (text)
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
Executing SQL: ALTER TABLE books ADD COLUMN title text
|
||||||
|
```
|
||||||
|
|
||||||
|
The payoff grows with the command. A single `create m:n relationship` — the
|
||||||
|
one-line way to
|
||||||
|
[link two tables many-to-many](/reference/relationships/#many-to-many-relationships)
|
||||||
|
— expands to an entire junction table: two foreign-key columns, a compound
|
||||||
|
primary key, and two cascading foreign keys, all spelled out in the echo.
|
||||||
|
|
||||||
|
<Demo src="/casts/sql-echo.cast" title="Simple-mode commands run in advanced mode each echo the SQL they run — ending with the m:n command expanding to a full junction table." />
|
||||||
|
|
||||||
|
Because the echo is exactly what runs, it doubles as a recipe: read it, copy
|
||||||
|
it, tweak it, and run your own version in advanced mode.
|
||||||
|
|||||||
@@ -25,9 +25,3 @@ Shows the type reference on its own.
|
|||||||
|
|
||||||
Outside the app, run `rdbms-playground --help` for the
|
Outside the app, run `rdbms-playground --help` for the
|
||||||
[command-line options](/using-the-playground/command-line-options/).
|
[command-line options](/using-the-playground/command-line-options/).
|
||||||
|
|
||||||
:::note[Planned]
|
|
||||||
A `hint` command for contextual help on the current input or the last error
|
|
||||||
is planned and not yet available — but the input already shows hints as you
|
|
||||||
type (see [The assistive editor](/using-the-playground/the-assistive-editor/)).
|
|
||||||
:::
|
|
||||||
|
|||||||
@@ -36,6 +36,5 @@ show more detail and is marked with a coloured border;
|
|||||||
|
|
||||||
:::note[Planned]
|
:::note[Planned]
|
||||||
A fuller session journal — a scrollable, richly rendered log of the whole
|
A fuller session journal — a scrollable, richly rendered log of the whole
|
||||||
session that you can save as Markdown — and multiple result tabs are planned
|
session that you can save as Markdown — is planned and not yet available.
|
||||||
and not yet available.
|
|
||||||
:::
|
:::
|
||||||
|
|||||||
Reference in New Issue
Block a user