Commit graph

1,128 commits

Author SHA1 Message Date
Simon Willison
f31b9fe5ca
Another link to Glitch 2019-05-16 06:26:46 -07:00
Simon Willison
7c79eb974b
It's 2019 now 2019-05-16 03:20:08 -07:00
Simon Willison
a464594475
Added inline contents for installation page 2019-05-16 03:15:03 -07:00
Simon Willison
a88b599cce Improved introduction copy on Plugins docs page 2019-05-15 22:18:02 -07:00
Simon Willison
725b5b6a69 Re-ordered documentation index page 2019-05-15 22:14:33 -07:00
Simon Willison
12350e8b8a Fixed broken link to global-power-plants demo 2019-05-15 22:12:36 -07:00
Simon Willison
8461b930d5 Wording tweaks 2019-05-15 22:09:06 -07:00
Simon Willison
8d639dd096 Docs on how to use sphinx-autobuild 2019-05-15 22:03:37 -07:00
Simon Willison
623c552ff4 'Try Datasette without installing anything using Glitch'
Also new 'Play with a live demo' section, both at the top of the Getting
Started documentation page.

https://datasette.readthedocs.io/en/latest/getting_started.html

Closes #464
2019-05-15 21:57:36 -07:00
Simon Willison
c0d1b4c322 "datasette inspect foo.db" now just calculates table counts
Refs #462

* inspect command now just outputs table counts
* test_inspect.py is now only tests for that CLI command
* Updated some relevant documentation
* Removed docs for /-/inspect since that is about to change
2019-05-11 14:36:57 -07:00
Simon Willison
37adf32290 Changelog for 0.27.1 2019-05-11 11:34:13 -07:00
Simon Willison
f825e20121 Run black and update docs for #457 2019-05-09 09:48:13 -07:00
Jaap Roes
f853d5592e "python3 -m pip" is clearer (thanks @jaap3) (#368) 2019-05-03 14:18:42 -04:00
Simon Willison
bade9daeb2 Docs for 'datasette publish cloudrun', refs #434 2019-05-03 12:16:58 -04:00
Russ Garrett
bf229c9bd8 Pass view_name to extra_body_script hook (#443)
At the moment it's not easy to tell whether the hook is being called
in (for example) the row or table view, as in both cases the
`database` and `table` parameters are provided.

This passes the `view_name` added in #441 to the `extra_body_script`
hook.
2019-05-03 09:12:19 -04:00
Simon Willison
ea66c45df9
Extract facet code out into a new plugin hook, closes #427 (#445)
Datasette previously only supported one type of faceting: exact column value counting.

With this change, faceting logic is extracted out into one or more separate classes which can implement other patterns of faceting - this is discussed in #427, but potential upcoming facet types include facet-by-date, facet-by-JSON-array, facet-by-many-2-many and more.

A new plugin hook, register_facet_classes, can be used by plugins to add in additional facet classes.

Each class must implement two methods: suggest(), which scans columns in the table to decide if they might be worth suggesting for faceting, and facet_results(), which executes the facet operation and returns results ready to be displayed in the UI.
2019-05-02 17:11:26 -07:00
Simon Willison
efc93b8ab5 Entirely removed table_rows_count table property
We were not displaying this anywhere, and it is now expensive to calculate.

Refs #419, #420
2019-05-01 22:29:47 -07:00
Russ Garrett
cf406c0754 New plugin hook: register_output_renderer hook (#441)
Thanks @russss!

* Add register_output_renderer hook

This changeset refactors out the JSON renderer and then adds a hook and
dispatcher system to allow custom output renderers to be registered.

The CSV output renderer is untouched because supporting streaming
renderers through this system would be significantly more complex, and
probably not worthwhile.

We can't simply allow hooks to be called at request time because we need
a list of supported file extensions when the request is being routed in
order to resolve ambiguous database/table names. So, renderers need to
be registered at startup.

I've tried to make this API independent of Sanic's request/response
objects so that this can remain stable during the switch to ASGI. I'm
using dictionaries to keep it simple and to make adding additional
options in the future easy.

Fixes #440
2019-05-01 16:01:56 -07:00
Simon Willison
9d73e3c8bd Note that trace data format is very likely to change, refs #435 2019-04-21 10:53:28 -07:00
Simon Willison
58a862cee4 ?_trace=1 now adds SQL trace info to JSON/HTML response
Also added documentation for it. Refs #435
2019-04-21 10:41:16 -07:00
Simon Willison
31f36e1b97
Added some guidelines
Mainly to remind me that master needs to be releasable at all times!
2019-04-20 11:32:40 -07:00
Simon Willison
583b22aa28 New ?column__date=yyyy-mm-dd filter 2019-04-15 15:54:54 -07:00
Simon Willison
1c6649b19b New colname__in=x,y,z filter, closes #433 2019-04-15 15:43:22 -07:00
Simon Willison
2c19a27d15 Documentation for filters, plus new documentation unit test
https://simonwillison.net/2018/Jul/28/documentation-unit-tests/
2019-04-15 15:41:11 -07:00
Simon Willison
9dc7a1824b
Slightly more interesting example link 2019-04-13 15:49:07 -07:00
Simon Willison
f2c767c222 Fixed broken link in documentation 2019-04-12 18:57:43 -07:00
Simon Willison
bc6a9b4564
?_where= parameter on table views, closes #429
From pull request #430
2019-04-12 18:37:22 -07:00
Simon Willison
db74cf0144 ?_fts_table= and ?_fts_pk= arguments, closes #428 2019-04-11 21:21:17 -07:00
Simon Willison
53bf875483 expand_foreign_keys() no longer uses inspect, refs #420 2019-04-06 19:56:07 -07:00
Simon Willison
47032636b5 'datasette serve -i immutable.db' option, refs #419 2019-03-17 16:25:15 -07:00
Simon Willison
6f6d0ff2b4
URL hashing is now off by default - closes #418
Prior to this commit Datasette would calculate the content hash of every
database and redirect to a URL containing that hash, like so:

    https://v0-27.datasette.io/fixtures => https://v0-27.datasette.io/fixtures-dd88475

This assumed that all databases were opened in immutable mode and were not
expected to change.

This will be changing as a result of #419 - so this commit takes the first step
in implementing that change by changing this default behaviour. Datasette will
now only redirect hash-free URLs under two circumstances:

* The new `hash_urls` config option is set to true (it defaults to false).
* The user passes `?_hash=1` in the URL
2019-03-17 15:55:04 -07:00
joelondon
9e8c36793b Update spatialite.rst (#413)
a line of sql added to create the idx_<table_name> in the python recipe
2019-03-14 22:06:45 -07:00
Simon Willison
9743e1d91b Support for :memory: databases
If you start Datasette with no files, it will connect to :memory: instead.

When starting it with files you can add --memory to also get a :memory: database.
2019-03-14 20:54:42 -07:00
Simon Willison
bf6b0f918d about and about_url metadata options 2019-03-14 20:54:42 -07:00
Simon Willison
41744d7690
Added datasette-jellyfish 2019-03-09 10:43:12 -08:00
Simon Willison
4147c388cb
Link to sqlite-utils blog entry 2019-03-07 20:30:21 -08:00
Simon Willison
1f91065b20
Added socrata2sql to the ecosystem page
A fantastic new tool created by @achavez at the Dallas Morning News.
2019-02-08 08:06:10 -08:00
Simon Willison
d5d39da12b
Expanded section on db-to-sqlite 2019-02-07 22:23:27 -08:00
Simon Willison
436b8bc1d1 Datasette 0.27 2019-01-31 19:47:05 -08:00
Simon Willison
b944bcd0f0 Added documentation on the Datasette Ecosystem
https://datasette.readthedocs.io/en/latest/ecosystem.html
2019-01-31 19:36:07 -08:00
Simon Willison
b5dd83981a Export option: _shape=array&_nl=on for newline-delimited JSON 2019-01-27 17:40:23 -08:00
Simon Willison
909cc8fbdf New 'datasette plugins' command to list installed plugins 2019-01-26 12:01:16 -08:00
Simon Willison
4722acc73c Release 0.26.1 2019-01-10 16:51:38 -08:00
Simon Willison
8ce7866312 compile_options output in /-/versions, closes #396 2019-01-10 16:44:50 -08:00
Simon Willison
5b02611512
Corrected import path in plugin docs 2019-01-08 16:25:29 -08:00
Simon Willison
424e146697 Datasette 0.26 release notes 2019-01-02 18:53:59 -08:00
Simon Willison
d95b46b09b datasette publish now --alias option
You can now use --alias to attempt to alias after you deploy.

Also updated now.json to use version: 1
2019-01-01 21:15:54 -08:00
Simon Willison
eac08f0dfc
--reload now also reloads if databases change on disk 2018-12-20 07:51:08 -08:00
Simon Willison
74ad06e128
Updated notes on FTS5 v.s. FTS4 2018-12-18 13:49:51 -08:00
Simon Willison
595da9054e
Better example commit
This one updates the README news section as well
2018-12-16 14:56:56 -08:00