You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1f02e2b
Browse filesBrowse the repository at this point in the historyBrowse files
Replaced links to fivethirtyeight.datasettes.com and the defunct
register-of-members-interests.datasettes.com with latest.datasette.io
and datasette.io equivalents, updated old ?sql= URL shapes to /-/query,
avoided datasette.io URLs that trigger the turnstile check, dropped
links to demos that now 404/500, and removed the docs for the
/-/metadata endpoint which no longer exists.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ The license and source information will be displayed on the index page and in th
74
74
75
75
## datasette publish
76
76
77
-
If you have [Heroku](https://heroku.com/) or [Google Cloud Run](https://cloud.google.com/run/) configured, Datasette can deploy one or more SQLite databases to the internet with a single command:
77
+
If you have [Heroku](https://www.heroku.com/) or [Google Cloud Run](https://cloud.google.com/run/) configured, Datasette can deploy one or more SQLite databases to the internet with a single command:
Copy file name to clipboardExpand all lines: docs/authentication.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -717,7 +717,7 @@ To limit access to the ``users`` table in your ``bakery.db`` database:
717
717
This works for SQL views as well - you can list their names in the ``"tables"`` block above in the same way as regular tables.
718
718
719
719
.. warning::
720
-
Restricting access to tables and views in this way will NOT prevent users from querying them using arbitrary SQL queries, `like this <https://latest.datasette.io/fixtures?sql=select+*+from+facetable>`__ for example.
720
+
Restricting access to tables and views in this way will NOT prevent users from querying them using arbitrary SQL queries, `like this <https://latest.datasette.io/fixtures/-/query?sql=select+*+from+facetable>`__ for example.
721
721
722
722
If you are restricting access to specific tables you should also use the ``"allow_sql"`` block to prevent users from bypassing the limit with their own SQL queries - see :ref:`authentication_permissions_execute_sql`.
This output format can also be used to return binary data from an arbitrary SQL query. Since such queries do not specify an exact row, an additional ``?_blob_hash=`` parameter can be used to specify the SHA-256 hash of the value that is being linked to.
99
99
100
-
Consider the query ``select data from binary_data`` - `demonstrated here <https://latest.datasette.io/fixtures?sql=select+data+from+binary_data>`__.
100
+
Consider the query ``select data from binary_data`` - `demonstrated here <https://latest.datasette.io/fixtures/-/query?sql=select+data+from+binary_data>`__.
101
101
102
102
That page links to the binary value downloads. Those links look like this:
These ``.blob`` links are also returned in the ``.csv`` and ``.tsv`` exports Datasette provides for binary tables and queries, since those formats do not have a mechanism for representing binary data.
Copy file name to clipboardExpand all lines: docs/contributing.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -312,7 +312,7 @@ To update these pages, run the following command::
312
312
Documentation screenshots
313
313
~~~~~~~~~~~~~~~~~~~~~~~~~
314
314
315
-
Screenshots in the documentation are defined in ``docs/shots.yml`` and taken using `shot-scraper <https://shot-scraper.datasette.io/>`__. That file starts a Datasette server that loads JavaScript from ``docs/shots/``, then saves each screenshot as a WebP image in ``docs/images/``.
315
+
Screenshots in the documentation are defined in ``docs/shots.yml`` and taken using `shot-scraper <https://shot-scraper.datasette.io/en/stable/>`__. That file starts a Datasette server that loads JavaScript from ``docs/shots/``, then saves each screenshot as a WebP image in ``docs/images/``.
316
316
317
317
To take any screenshots that do not exist yet, run::
Copy file name to clipboardExpand all lines: docs/deploying.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,7 +123,7 @@ These two files should be enough to deploy Datasette on any host that supports b
123
123
124
124
If you want to build SQLite files or download them as part of the deployment process you can do so using a ``bin/post_compile`` file. For example, the following ``bin/post_compile`` will download an example database that will then be served by Datasette::
`simonw/buildpack-datasette-demo <https://github.com/simonw/buildpack-datasette-demo>`__ is an example GitHub repository showing a Datasette configuration that can be deployed to a buildpack-supporting host.
Copy file name to clipboardExpand all lines: docs/ecosystem.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ The `Datasette project website <https://datasette.io/>`__ includes a directory o
16
16
sqlite-utils
17
17
============
18
18
19
-
`sqlite-utils <https://sqlite-utils.datasette.io/>`__ is a key building block for the wider Datasette ecosystem. It provides a collection of utilities for manipulating SQLite databases, both as a Python library and a command-line utility. Features include:
19
+
`sqlite-utils <https://sqlite-utils.datasette.io/en/stable/>`__ is a key building block for the wider Datasette ecosystem. It provides a collection of utilities for manipulating SQLite databases, both as a Python library and a command-line utility. Features include:
20
20
21
21
- Insert data into a SQLite database from JSON, CSV or TSV, automatically creating tables with the correct schema or altering existing tables to add missing columns.
22
22
- Configure tables for use with SQLite full-text search, including creating triggers needed to keep the search index up-to-date.
Copy file name to clipboardExpand all lines: docs/facets.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Datasette facets can be used to add a faceted browse interface to any database t
7
7
With facets, tables are displayed along with a summary showing the most common values in specified columns.
8
8
These values can be selected to further filter the table.
9
9
10
-
Here's `an example <https://datasette.io/legislators/legislator_terms?_facet=type&_facet=party&_facet=state&_facet_size=10>`__:
10
+
Here's `an example <https://latest.datasette.io/fixtures/facetable?_facet=state&_facet=_city_id&_facet=on_earth>`__ against a demo table. This screenshot shows facets against a table of US legislators:
:alt:Screenshot showing facets against a table of congressional legislators. Suggested facets include state_rank and start and end dates, and the displayed facets are state, party and type. Each facet lists values along with a count of rows for each value.
Copy file name to clipboardExpand all lines: docs/full_text_search.rst
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ Full-text search
5
5
6
6
SQLite includes `a powerful mechanism for enabling full-text search <https://www.sqlite.org/fts3.html>`_ against SQLite records. Datasette can detect if a table has had full-text search configured for it in the underlying database and display a search interface for filtering that table.
7
7
8
-
Here's `an example search <https://register-of-members-interests.datasettes.com/regmem/items?_search=hamper&_sort_desc=date>`__:
8
+
Here's `an example search <https://datasette.io/content/repos?_search=csv>`__ for Datasette ecosystem repositories mentioning "csv". This screenshot shows a search against a table of items registered by UK MPs:
:alt:Screenshot showing a search for hampers against a table full of items - 453 results are returned.
@@ -120,31 +120,31 @@ Searches using custom SQL
120
120
121
121
You can include full-text search results in custom SQL queries. The general pattern with SQLite search is to run the search as a sub-select that returns rowid values, then include those rowids in another part of the query.
122
122
123
-
You can see the syntax for a basic search by running that search on a table page and then clicking "View and edit SQL" to see the underlying SQL. For example, consider this search for `repositories mentioning "csv" <https://datasette.io/content/repos?_search=csv>`_::
123
+
You can see the syntax for a basic search by running that search on a table page and then clicking "View and edit SQL" to see the underlying SQL. For example, consider this search for `rows mentioning "dog" <https://latest.datasette.io/fixtures/searchable?_search=dog>`_::
124
124
125
-
/content/repos?_search=csv
125
+
/fixtures/searchable?_search=dog
126
126
127
-
The generated SQL selects all columns in the table. This simplified version selects just the repository ID, full name and description, using the same full-text search condition. `Run this query <https://datasette.io/content?sql=select%0A++id%2C%0A++full_name%2C%0A++description%0Afrom%0A++repos%0Awhere%0A++rowid+in+%28%0A++++select%0A++++++rowid%0A++++from%0A++++++repos_fts%0A++++where%0A++++++repos_fts+match+escape_fts%28%3Asearch%29%0A++%29%0Aorder+by%0A++id%0Alimit%0A++101&search=csv>`_ with ``search`` set to ``csv``:
127
+
The generated SQL selects all columns in the table. This simplified version selects just the primary key and the two text columns, using the same full-text search condition. `Run this query <https://latest.datasette.io/fixtures/-/query?sql=select%0A++pk%2C%0A++text1%2C%0A++text2%0Afrom%0A++searchable%0Awhere%0A++rowid+in+%28%0A++++select%0A++++++rowid%0A++++from%0A++++++searchable_fts%0A++++where%0A++++++searchable_fts+match+escape_fts%28%3Asearch%29%0A++%29%0Aorder+by%0A++pk%0Alimit%0A++101&search=dog>`_ with ``search`` set to ``dog``:
128
128
129
129
.. code-block:: sql
130
130
131
131
select
132
-
id,
133
-
full_name,
134
-
description
132
+
pk,
133
+
text1,
134
+
text2
135
135
from
136
-
repos
136
+
searchable
137
137
where
138
138
rowid in (
139
139
select
140
140
rowid
141
141
from
142
-
repos_fts
142
+
searchable_fts
143
143
where
144
-
repos_fts match escape_fts(:search)
144
+
searchable_fts match escape_fts(:search)
145
145
)
146
146
order by
147
-
id
147
+
pk
148
148
limit
149
149
101
150
150
@@ -163,7 +163,7 @@ To set up full-text search for a table, you need to do two things:
163
163
Configuring FTS using sqlite-utils
164
164
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
165
165
166
-
`sqlite-utils <https://sqlite-utils.datasette.io/>`__ is a CLI utility and Python library for manipulating SQLite databases. You can use `it from Python code <https://sqlite-utils.datasette.io/en/latest/python-api.html#enabling-full-text-search>`__ to configure FTS search, or you can achieve the same goal `using the accompanying command-line tool <https://sqlite-utils.datasette.io/en/latest/cli.html#configuring-full-text-search>`__.
166
+
`sqlite-utils <https://sqlite-utils.datasette.io/en/stable/>`__ is a CLI utility and Python library for manipulating SQLite databases. You can use `it from Python code <https://sqlite-utils.datasette.io/en/latest/python-api.html#enabling-full-text-search>`__ to configure FTS search, or you can achieve the same goal `using the accompanying command-line tool <https://sqlite-utils.datasette.io/en/latest/cli.html#configuring-full-text-search>`__.
167
167
168
168
Here's how to use ``sqlite-utils`` to enable full-text search for an ``items`` table across the ``name`` and ``description`` columns::
169
169
@@ -179,7 +179,7 @@ If your data starts out in CSV files, you can use Datasette's companion tool `cs
179
179
Configuring FTS by hand
180
180
~~~~~~~~~~~~~~~~~~~~~~~
181
181
182
-
We recommend using `sqlite-utils <https://sqlite-utils.datasette.io/>`__, but if you want to hand-roll a SQLite full-text search table you can do so using the following SQL.
182
+
We recommend using `sqlite-utils <https://sqlite-utils.datasette.io/en/stable/>`__, but if you want to hand-roll a SQLite full-text search table you can do so using the following SQL.
183
183
184
184
To enable full-text search for a table called ``items`` that works against the ``name`` and ``description`` columns, you would run this SQL to create a new ``items_fts`` FTS virtual table:
Copy file name to clipboardExpand all lines: docs/getting_started.rst
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Play with a live demo
9
9
The best way to experience Datasette for the first time is with a demo:
10
10
11
11
* `datasette.io/global-power-plants <https://datasette.io/global-power-plants/global-power-plants>`__ provides a searchable database of power plants around the world, using data from the `World Resources Institude <https://www.wri.org/publication/global-power-plant-database>`__ rendered using the `datasette-cluster-map <https://github.com/simonw/datasette-cluster-map>`__ plugin.
12
-
* `fivethirtyeight.datasettes.com<https://fivethirtyeight.datasettes.com/fivethirtyeight>`__ shows Datasette running against over 400 datasets imported from the `FiveThirtyEight GitHub repository <https://github.com/fivethirtyeight/data>`__.
12
+
* `latest.datasette.io<https://latest.datasette.io/>`__ runs the latest version of Datasette from the main branch against the test fixtures database, demonstrating most of Datasette's features.
13
13
14
14
.. _getting_started_tutorial:
15
15
@@ -20,7 +20,7 @@ Datasette has several `tutorials <https://datasette.io/tutorials>`__ to help you
20
20
21
21
- `Exploring a database with Datasette <https://datasette.io/tutorials/explore>`__ shows how to use the Datasette web interface to explore a new database.
22
22
- `Learn SQL with Datasette <https://datasette.io/tutorials/learn-sql>`__ introduces SQL, and shows how to use that query language to ask questions of your data.
23
-
- `Cleaning data with sqlite-utils and Datasette <https://datasette.io/tutorials/clean-data>`__ guides you through using `sqlite-utils <https://sqlite-utils.datasette.io/>`__ to turn a CSV file into a database that you can explore using Datasette.
23
+
- `Cleaning data with sqlite-utils and Datasette <https://datasette.io/tutorials/clean-data>`__ guides you through using `sqlite-utils <https://sqlite-utils.datasette.io/en/stable/>`__ to turn a CSV file into a database that you can explore using Datasette.
Copy file name to clipboardExpand all lines: docs/index.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ Datasette is a tool for exploring and publishing data. It helps people take data
25
25
26
26
Datasette is aimed at data journalists, museum curators, archivists, local governments and anyone else who has data that they wish to share with the world. It is part of a :ref:`wider ecosystem of tools and plugins <ecosystem>` dedicated to making working with structured data as productive as possible.
27
27
28
-
`Explore a demo <https://fivethirtyeight.datasettes.com/fivethirtyeight>`__, watch `a presentation about the project <https://static.simonwillison.net/static/2018/pybay-datasette/>`__.
28
+
`Explore a demo <https://datasette.io/global-power-plants/global-power-plants>`__, watch `a presentation about the project <https://static.simonwillison.net/static/2018/pybay-datasette/>`__.
29
29
30
30
Interested in learning Datasette? Start with `the official tutorials <https://datasette.io/tutorials>`__.
0 commit comments