Simon Willison
0b8e5981a3
Typo fix
2018-05-20 14:30:48 -07:00
Simon Willison
bd3353a31f
Added docs for introspection endpoints
...
https://datasette.readthedocs.io/en/latest/introspection.html
2018-05-20 14:28:53 -07:00
Simon Willison
f00137c8ac
Only apply responsive table CSS to .rows-and-columns
2018-05-20 10:45:01 -07:00
Simon Willison
f6183ff5fa
Renamed --limit to --config, added --help-config, closes #274
...
Removed the --page_size= argument to datasette serve in favour of:
datasette serve --config default_page_size:50 mydb.db
Added new help section:
$ datasette --help-config
Config options:
default_page_size Default page size for the table view
(default=100)
max_returned_rows Maximum rows that can be returned from a table
or custom query (default=1000)
sql_time_limit_ms Time limit for a SQL query in milliseconds
(default=1000)
default_facet_size Number of values to return for requested facets
(default=30)
facet_time_limit_ms Time limit for calculating a requested facet
(default=200)
facet_suggest_time_limit_ms Time limit for calculating a suggested facet
(default=50)
2018-05-20 10:01:49 -07:00
Simon Willison
918de9403e
Only apply responsive table styles to .rows-and-column
...
Otherwise they interfere with tables in the description, e.g. on
https://fivethirtyeight.datasettes.com/fivethirtyeight/nba-elo%2Fnbaallelo
2018-05-20 08:10:46 -07:00
Simon Willison
b8227556c6
Suggested facets now use #fragment links
...
Useful for pages with large amounts of content at the top like on
https://fivethirtyeight.datasettes.com/fivethirtyeight-469e30d/nba-elo%2Fnbaallelo
2018-05-18 09:18:51 -07:00
Simon Willison
2c2e67b9bb
Updated default facet limits in docs
2018-05-18 08:50:37 -07:00
Simon Willison
39426ff0e4
Added /-/limits and /-/limits.json, closes #270
2018-05-17 23:16:28 -07:00
Simon Willison
08f4b7658f
Show facets that timed out using new InterruptedError
...
If the user requests some _facet= options that do not successfully execute in
the configured facet_time_limit_ms, we now show a warning message like this:
These facets timed out: rowid, Title
To build this I had to clean up our SQLite interrupted logic. We now raise a
custom InterruptedError exception when SQLite terminates due to exceeding a
time limit.
In implementing this I found and fixed a logic error where invalid SQL was
being generated in some cases for our faceting calculations but the resulting
sqlite3.OperationalError had been incorrectly captured and treated as a
timeout.
Refs #255
Closes #269
2018-05-17 23:11:23 -07:00
Simon Willison
cef9a9a870
--limit= mechanism plus new limits for facets
...
Replaced the --max_returned_rows and --sql_time_limit_ms options to
"datasette serve" with a new --limit option, which supports a larger
list of limits.
Example usage:
datasette serve --limit max_returned_rows:1000 \
--limit sql_time_limit_ms:2500 \
--limit default_facet_size:50 \
--limit facet_time_limit_ms:1000 \
--limit facet_suggest_time_limit_ms:500
New docs: https://datasette.readthedocs.io/en/latest/limits.html
Closes #270
Closes #264
2018-05-17 22:08:26 -07:00
Simon Willison
8003a13331
Empty string "" facets can now be selected in UI, refs #255
2018-05-17 06:34:42 -07:00
Simon Willison
5e78d11c24
Docs: Speeding up facets with indexes
2018-05-16 21:08:50 -07:00
Simon Willison
7261584f04
Display currently selected facets better, refs #255
2018-05-16 19:42:31 -07:00
Simon Willison
96aac7f9e9
Facet documentation tweaks
2018-05-16 13:50:34 -07:00
Simon Willison
9959a9e4de
Added screenshots to facets and full_text_search docs, refs #255
2018-05-16 08:27:24 -07:00
Simon Willison
858d79fe93
Typo fix
2018-05-16 08:27:24 -07:00
Simon Willison
566f2d31d6
Clarified relationship between metadata and _facet= facets, updated docs - refs @255
2018-05-16 08:27:24 -07:00
Simon Willison
b263da78e3
Reliable sort order for facets in Python 3.5, fixing test - refs #255
2018-05-16 08:27:24 -07:00
Simon Willison
062303419c
Hide facet button is now a ✖ - refs #255
2018-05-16 08:27:24 -07:00
Simon Willison
62f1d3a6cb
class="suggested-facets"
2018-05-16 08:27:24 -07:00
Simon Willison
91bf5f56bb
Show enabled facets in flexbox columns, refs #255
2018-05-16 08:27:24 -07:00
Simon Willison
6d12580ed7
Foreign key facets are now expanded to labels, refs #255
2018-05-16 08:27:24 -07:00
Simon Willison
a892f9a0bd
Use escape_sqlite() more consistently
2018-05-16 08:27:24 -07:00
Simon Willison
8a0bd68c39
Undid some slightly weird code formatting by 'black'
2018-05-16 08:27:24 -07:00
Simon Willison
63aac537f2
1,442 format for facet counts, refs #255
2018-05-16 08:27:24 -07:00
Simon Willison
f4943ca89b
_facet selections persist through table form, refs #255
2018-05-16 08:27:24 -07:00
Simon Willison
514873c629
Fix bug with toggle_url on integer facets
2018-05-16 08:27:24 -07:00
Simon Willison
1dc94f6eaa
Facets can now be toggled off again, refs #255
2018-05-16 08:27:24 -07:00
Simon Willison
ba515fc56e
Removed un-used variable
2018-05-16 08:27:24 -07:00
Simon Willison
142a550a99
Facet results now have "truncated" field
...
To indicate if there was more than 20 distinct values. Refs #255
2018-05-16 08:27:24 -07:00
Simon Willison
a82175276c
_sort/_next links now use new path_with_replaced_args method
2018-05-16 08:27:24 -07:00
Simon Willison
2f81552cd2
Never suggest a facet if it only results in on option
2018-05-16 08:27:24 -07:00
Simon Willison
b0d2bb3e43
Facets no longer consider null values
2018-05-16 08:27:24 -07:00
Simon Willison
ddef229850
Initial implementation of suggested facets
...
Causes tests to break at the moment
2018-05-16 08:27:24 -07:00
Simon Willison
8a4ed052a5
path_with_added_args now works with multiple existing args
2018-05-16 08:27:24 -07:00
Simon Willison
f36c9d4b4c
Facet toggling now works for integer columns, refs #255
2018-05-16 08:27:24 -07:00
Simon Willison
de05cf21aa
Facet "selected" key and toggle_url now toggles, refs #255
2018-05-16 08:27:24 -07:00
Simon Willison
2b79f2bdeb
path_with_added_args now preserves order in Python 3.5
2018-05-14 00:04:23 -03:00
Simon Willison
eaf715a60a
Extract /-/plugins view into a method
2018-05-14 00:04:23 -03:00
Simon Willison
cf1fe693e5
Used isort to re-order my imports
2018-05-14 00:04:23 -03:00
Simon Willison
3686385551
Ran black source formatting tool against new views/ and app.py
2018-05-14 00:04:23 -03:00
Simon Willison
1f69269fe9
Refactored views into new views/ modules, refs #256
2018-05-14 00:04:23 -03:00
Simon Willison
4301a8f3ac
Case insensitive querystring comparison, fix Python 3.5
2018-05-12 19:49:37 -03:00
Simon Willison
eaaa3ea149
Initial implementation of facets, plus tests and docs
...
Refs #255
2018-05-12 19:29:41 -03:00
Simon Willison
70ff615f1b
utils.path_with_added_args() improvements
...
* Now covered by unit tests
* Preserves original order
* Can handle multiple args of the same name, e.g. ?bar=1&bar=2
2018-05-12 18:44:09 -03:00
Simon Willison
1c815207cc
Update conf.py
2018-05-12 09:08:11 -03:00
Simon Willison
694f845715
Documentation for SQLite full-text search support, closes #253
2018-05-12 09:06:38 -03:00
Simon Willison
04d21ccd08
/-/versions now includes SQLite fts_versions, closes #252
2018-05-11 10:19:25 -03:00
Simon Willison
e10f8e1274
Slight simplification of /-/inspect
2018-05-06 10:05:38 -03:00
Simon Willison
8e0f072847
Added Datasette 0.21 to News
2018-05-05 20:24:55 -03:00