Commit graph

25 commits

Author SHA1 Message Date
Robert Gieseke
eda848b37f Add keyboard shortcut to execute SQL query (#115) 2017-11-17 06:22:55 -08:00
Simon Willison
01e0c3fa18 Fixed   bug
  was showing for all None values in table cells, thanks to the
autoescaping change introduced in 82261a638b
2017-11-16 07:29:52 -08:00
Simon Willison
228bce83a3 Added __version__, bumped it to 0.12
Closes #108
2017-11-16 07:20:54 -08:00
Simon Willison
5d8084a285 Added a UI for editing named parameters
Fixes #96
2017-11-15 17:32:48 -08:00
Simon Willison
4f7281af8c Apply a default height to CodeMirror
Makes it a bit more obvious that it's an editable textarea even
if the SQL in it is only one line long.
2017-11-14 18:04:04 -08:00
Tom Dyson
8252daa4c1 SQL syntax highlighting with Codemirror (#89) 2017-11-14 18:03:00 -08:00
Simon Willison
7dac1c05cd Improved pagination
Closes #78
2017-11-13 12:34:56 -08:00
Simon Willison
d76412668f Removed rogue middot 2017-11-13 12:34:39 -08:00
Simon Willison
8252e71da4 Limit on max rows returned, controlled by --max_returned_rows option
If someone executes 'select * from table' against a table with a million rows
in it, we could run into problems: just serializing that much data as JSON is
likely to lock up the server.

Solution: we now have a hard limit on the maximum number of rows that can be
returned by a query. If that limit is exceeded, the server will return a
`"truncated": true` field in the JSON.

This limit can be optionally controlled by the new `--max_returned_rows`
option. Setting that option to 0 disables the limit entirely.

Closes #69
2017-11-13 11:33:01 -08:00
Simon Willison
3ef35ca8b4 serve and publish commands now take a --metadata option
If provided, the --metadata option is the path to a JSON file containing
metadata that should be displayed alongside the dataset.

    datasette /tmp/fivethirtyeight.db --metadata /tmp/metadata.json

Currently that metadata format looks like this:

    {
        "title": "Five Thirty Eight",
        "license": "CC Attribution 4.0 License",
        "license_url": "http://creativecommons.org/licenses/by/4.0/",
        "source": "fivethirtyeight/data on GitHub",
        "source_url": "https://github.com/fivethirtyeight/data"
    }

If provided, this will be used by the index template and to populate the
common footer.

The publish command also accepts this argument, and will package any provided
metadata up and include it with the resulting Docker container.

    datasette publish --metadata /tmp/metadata.json /tmp/fivethirtyeight.db

Closes #68
2017-11-13 07:20:02 -08:00
Simon Willison
d01370f166 Show SQL and params if table has them applied 2017-11-12 15:21:39 -08:00
Simon Willison
26370b14d8 Handle table names with slashes in them
e.g. https://datasette-wdlexdiaoz.now.sh/fivethirtyeight-75d605c/bob-ross%2Felements-by-episode.csv?CABIN=1&BUSHES=1&CLOUDS=1
2017-11-12 15:17:00 -08:00
Simon Willison
db3fa4abfa Views no longer attempt to link to records
Closes #54
2017-11-12 13:29:26 -08:00
Simon Willison
59a616ca5c Move view SQL to bottom of the page
Now consistent with tables
2017-11-12 13:25:34 -08:00
Simon Willison
22851ed9f0 Table page now shows CREATE TABLE at bottom
Closes #66
2017-11-12 13:16:59 -08:00
Simon Willison
666aa03253 Improved error handling
Invalid SQL now shows a special error.html template, and is covered by tests.
2017-11-12 13:16:15 -08:00
Simon Willison
ff2ab9dc7d Views now show their SQL, are handled a bit better
Refs #66
2017-11-12 12:32:25 -08:00
Simon Willison
59580d02da Implemented custom SQL via textarea
Closes #65
2017-11-11 18:35:35 -08:00
Simon Willison
fd3a33989a Implemented new database view and template
Closes #53 - see comments there for screenshots.
2017-11-11 17:50:21 -08:00
Simon Willison
2366a016f2 Added links to .json and .jsono representations
Closes #62
2017-11-11 14:40:44 -08:00
Simon Willison
e9e1def4c0 Revised JSON design a bit
Closes #63
2017-11-11 14:20:00 -08:00
Simon Willison
e4bf66d9b0 Added header with breadcrumbs and footer
Also cleaned up titles on various pages.

Closes #61
2017-11-11 12:36:20 -08:00
Simon Willison
7d81083d40 Implemented responsive tables, removed bootstrap
No need for all of bootstrap since we only need to style a few elements.

Implemented responsive table pattern from here:
https://css-tricks.com/responsive-data-tables/

Refs #16
2017-11-10 21:55:50 -08:00
Simon Willison
21c9c04310 Implemented cursor-based pagination for table view
Closes #5
2017-11-10 12:41:14 -08:00
Simon Willison
e7e50875d3 Renamed to 'datasette' 2017-11-10 10:38:35 -08:00