mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
/db/table/-/blob/pk/column.blob download URL, refs #1036
This commit is contained in:
parent
10c35bd371
commit
5a15197960
9 changed files with 183 additions and 66 deletions
|
|
@ -385,7 +385,15 @@ The ``datasette.urls`` object contains methods for building URLs to pages within
|
|||
For example, ``datasette.urls.path("-/logout")`` will return the path to the logout page, which will be ``"/-/logout"`` by default or ``/prefix-path/-/logout`` if ``base_url`` is set to ``/prefix-path/``
|
||||
|
||||
``datasette.urls.logout()``
|
||||
Returns the URL to the logout page, usually ``"/-/logout"``.
|
||||
Returns the URL to the logout page, usually ``"/-/logout"``
|
||||
|
||||
``datasette.urls.static(path)``
|
||||
Returns the URL of one of Datasette's default static assets, for example ``"/-/static/app.css"``
|
||||
|
||||
``datasette.urls.static_plugins(plugin_name, path)``
|
||||
Returns the URL of one of the static assets belonging to a plugin.
|
||||
|
||||
``datasette.url.static_plugins("datasette_cluster_map", "datasette-cluster-map.js")`` would return ``"/-/static-plugins/datasette_cluster_map/datasette-cluster-map.js"``
|
||||
|
||||
``datasette.urls.static(path)``
|
||||
Returns the URL of one of Datasette's default static assets, for example ``"/-/static/app.css"``.
|
||||
|
|
|
|||
|
|
@ -77,3 +77,14 @@ Note that this URL includes the encoded primary key of the record.
|
|||
Here's that same page as JSON:
|
||||
|
||||
`../people/uk.org.publicwhip%2Fperson%2F10001.json <https://register-of-members-interests.datasettes.com/regmem/people/uk.org.publicwhip%2Fperson%2F10001.json>`_
|
||||
|
||||
.. _BlobView:
|
||||
|
||||
Blob
|
||||
====
|
||||
|
||||
SQLite databases can contain binary data, stored in a ``BLOB`` column. Datasette makes the content of these columns available to download directly, at URLs that look like the following::
|
||||
|
||||
/database-name/table-name/-/blob/row-identifier/column-name.blob
|
||||
|
||||
Binary content is also made available as a base64 encoded string in the ``.json`` representation of the row.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue