Skip to content

Commit a2c258d

Browse files
committed
make sql console be its own sub page
1 parent 10aa687 commit a2c258d

File tree

3 files changed

+29
-23
lines changed

3 files changed

+29
-23
lines changed

docs/hub/_toctree.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@
208208
title: Configure the Dataset Viewer
209209
- local: datasets-viewer-embed
210210
title: Embed the Dataset Viewer in a webpage
211+
- local: datasets-viewer-sql-console
212+
title: "SQL Console: Query datasets in the browser"
211213
- local: datasets-download-stats
212214
title: Datasets Download Stats
213215
- local: datasets-data-files-configuration
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# SQL Console: Query datasets in the browser
2+
3+
You can run SQL queries on the dataset in the browser using the SQL Console. The SQL Console is powered by [DuckDB](https://duckdb.org/) WASM and runs entirely in the browser. You can access the SQL Console from the dataset page by clicking on the **SQL Console** badge.
4+
5+
<div class="flex justify-center">
6+
<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/sql_console/sql-console-histogram.png"/>
7+
<img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/sql_console/sql-console-histogram-dark.png"/>
8+
</div>
9+
10+
<p class="text-sm text-center italic">
11+
To learn more about the SQL Console, see the <a href="https://huggingface.co/blog/sql-console" target="_blank" rel="noopener noreferrer">SQL Console blog post</a>.
12+
</p>
13+
14+
15+
Through the SQL Console, you can:
16+
17+
- Run [DuckDB SQL queries](https://duckdb.org/docs/sql/query_syntax/select) on the dataset (_checkout [SQL Snippets](https://huggingface.co/spaces/cfahlgren1/sql-snippets) for useful queries_)
18+
- Share results of the query with others via a link (_check out [this example](https://huggingface.co/datasets/gretelai/synthetic-gsm8k-reflection-405b?sql_console=true&sql=FROM+histogram%28%0A++train%2C%0A++topic%2C%0A++bin_count+%3A%3D+10%0A%29)_)
19+
- Download the results of the query to a parquet file
20+
- Embed the results of the query in your own webpage using an iframe
21+
22+
<Tip>
23+
You can also use the DuckDB CLI to query the dataset via the `hf://` protocol. See the <a href="https://huggingface.co/docs/hub/en/datasets-duckdb" target="_blank" rel="noopener noreferrer">DuckDB CLI documentation</a> for more information.
24+
</Tip>

docs/hub/datasets-viewer.md

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,10 @@ Similarly, if you select one class from a categorical column, it will show only
2020

2121
You can search for a word in the dataset by typing it in the search bar at the top of the table. The search is case-insensitive and will match any row containing the word. The text is searched in the columns of `string`, even if the values are nested in a dictionary or a list.
2222

23-
## Using the SQL Console to query the dataset
23+
## Run SQL queries on the dataset
2424

25-
You can run SQL queries on the dataset in the browser using the SQL Console. The SQL Console is powered by [DuckDB](https://duckdb.org/) WASM and runs entirely in the browser. You can access the SQL Console from the dataset page by clicking on the **SQL Console** badge.
26-
27-
<div class="flex justify-center">
28-
<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/sql_console/sql-console-histogram.png"/>
29-
<img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/sql_console/sql-console-histogram-dark.png"/>
30-
</div>
31-
32-
<p class="text-sm text-center italic">
33-
To learn more about the SQL Console, see the <a href="https://huggingface.co/blog/sql-console" target="_blank" rel="noopener noreferrer">SQL Console blog post</a>.
34-
</p>
35-
36-
37-
Through the SQL Console, you can:
38-
39-
- Run [DuckDB SQL queries](https://duckdb.org/docs/sql/query_syntax/select) on the dataset (_checkout [SQL Snippets](https://huggingface.co/spaces/cfahlgren1/sql-snippets) for useful queries_)
40-
- Share results of the query with others via a link (_check out [this example](https://huggingface.co/datasets/gretelai/synthetic-gsm8k-reflection-405b?sql_console=true&sql=FROM+histogram%28%0A++train%2C%0A++topic%2C%0A++bin_count+%3A%3D+10%0A%29)_)
41-
- Download the results of the query to a parquet file
42-
- Embed the results of the query in your own webpage using an iframe
43-
44-
<Tip>
45-
You can also use the DuckDB CLI to query the dataset via the `hf://` protocol. See the <a href="https://huggingface.co/docs/hub/en/datasets-duckdb" target="_blank" rel="noopener noreferrer">DuckDB CLI documentation</a> for more information.
46-
</Tip>
25+
You can run SQL queries on the dataset in the browser using the SQL Console.
26+
For more information see our guide on [SQL Console: Query the dataset in the browser](./datasets-viewer-sql-console).
4727

4828
## Share a specific row
4929

0 commit comments

Comments
 (0)