Commit graph

2,138 commits

Author SHA1 Message Date
Simon Willison
b9af49be6c
Fix case for Sanic dependency
On PyPI it has a capital letter: https://pypi.python.org/pypi/Sanic

I think this is why the list of "Requires Distributions" on https://pypi.python.org/pypi/datasette links to all of the other dependencies but does not link to Sanic.
2017-11-17 05:26:05 -08:00
Ariel Núñez
8b4c600d98 Add spatialite, switch to debian and local build (#114) 2017-11-16 19:50:51 -08:00
Simon Willison
b7c4165346 Added --load-extension argument to datasette serve
Allows loading of SQLite extensions. Refs #110.
2017-11-16 08:48:49 -08:00
Simon Willison
9e27b2a0ba Add example of named parameter UI to the release notes 2017-11-16 08:46:25 -08:00
Simon Willison
5bfb23b949
Added Read The Docs badge
Closes #109
2017-11-16 08:13:55 -08:00
Simon Willison
a9138f044a Added date to most recent changelog entry 2017-11-16 07:40:43 -08:00
Simon Willison
51bdd67691 Changelog for 0.12 release 0.12 2017-11-16 07:37:46 -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
e6ca885883 Added initial docs, including a changelog
Docs initialized using this helpful guide:

http://docs.readthedocs.io/en/latest/getting_started.html

I used https://pypi.python.org/pypi/gitchangelog to kick-start the changelog.

Closes #99

Refs #109
2017-11-16 07:11:00 -08:00
Simon Willison
9199945a1b Fixed 500 on views page
Bug introduced in a4af532a31

Refs 85
2017-11-16 06:46:49 -08:00
Simon Willison
82261a638b Turn on auto-escaping in Jinja
We had XSS holes! Since we don't do cookies or authentication
they shouldn't cause any actual harm, but still really not good.

https://github.com/pallets/jinja/issues/528
2017-11-15 17:59:42 -08:00
Simon Willison
a4af532a31 Include foreign key info in inspect() output
Refs #85
2017-11-15 17:34:32 -08:00
Simon Willison
5d8084a285 Added a UI for editing named parameters
Fixes #96
2017-11-15 17:32:48 -08:00
Simon Willison
9f47b6e4d8 Pin to specific Jinja version
Closes #100
2017-11-15 16:14:07 -08:00
Jacob Kaplan-Moss
f48cb705d8 Initial cut at datasette publish heroku
Rather gross, but proves that it works.
2017-11-15 11:53:00 -08:00
Simon Willison
f45ca30f91 Fixed bug with datasette package --metadata
Closes #84
2017-11-14 21:18:29 -08:00
Simon Willison
ea183b2ae3 Default to 127.0.0.1 not 0.0.0.0
Closes #98
2017-11-14 21:08:46 -08:00
Simon Willison
7fe1e8b482 Added extra metadata options to publish and package commands
You can now run these commands like so:

    datasette now publish mydb.db \
        --title="My Title" \
        --source="Source" \
        --source_url="http://www.example.com/" \
        --license="CC0" \
        --license_url="https://creativecommons.org/publicdomain/zero/1.0/"

This will write those values into the metadata.json that is packaged with the
app. If you also pass --metadata= that file will be updated with the extra
values before being written into the Docker image.

Closes #92
2017-11-14 21:02:11 -08:00
Andrew Cutler
86755503d2 Initial add simple prod ready Dockerfile refs #57 (#94) 2017-11-14 19:08:04 -08:00
Simon Willison
9cb69cbd45 New ?_sql_time_limit_ms=10 argument to database and table page
Allows callers to opt for a lower time limit.

Closes #95
2017-11-14 18:55:10 -08:00
Simon Willison
0b8c1b0a6d Test for sql_time_limit_ms + sqlite_functions mechanism
Added a unit test for the sql_time_limit_ms option.

To test this, I needed to add a custom SQLite sleep() function. I've added a
simple mechanism to the Datasette class for registering custom functions.

I also had to modify the sqlite_timelimit() function. It makes use of a magic
value, N, which is the number of SQLite virtual machine instructions that
should execute in between calls to my termination decision function.

The value of N was not finely grained enough for my test to work - so I've
added logic that says that if the time limit is less than 50ms, N is set to 1.
This got the tests working.

Refs #95
2017-11-14 18:43:34 -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
Simon Willison
cbb59e3801 Handle tables with names that start with digits 2017-11-14 18:03:21 -08:00
Tom Dyson
8252daa4c1 SQL syntax highlighting with Codemirror (#89) 2017-11-14 18:03:00 -08:00
Simon Willison
075d422c0a
Fixed typo 2017-11-13 21:28:02 -08:00
Simon Willison
98ae6d6a40
Added link to examples 2017-11-13 21:27:21 -08:00
Simon Willison
b0f3d4e375 Version 0.11 0.11 2017-11-13 17:48:22 -08:00
Simon Willison
fc7c04fe0b Added 'datasette publish now --force' option
This calls now with --force - which is useful as it means you get a fresh copy of
datasette even if now has already cached that docker layer.
2017-11-13 17:48:03 -08:00
Simon Willison
00527e5c62 Enable --cors by default in containers 2017-11-13 17:23:22 -08:00
Simon Willison
5928c11ee7 Version 0.10 0.10 2017-11-13 16:45:23 -08:00
Simon Willison
50e817801f Fixed #83
Turns out we had a redirect bug as well.
2017-11-13 16:44:43 -08:00
Simon Willison
bdfb6d4f13
Fixed package output example 2017-11-13 14:18:44 -08:00
Jeff Triplett
06a826c318 🔥 Removes DS_Store (#81)
* 🔥 Removes .DS_Store

Signed-off-by: Jeff Triplett <jeff.triplett@gmail.com>

* ❄️ Adds .DS_Store to gitignore

Signed-off-by: Jeff Triplett <jeff.triplett@gmail.com>
2017-11-13 14:16:54 -08:00
Simon Willison
44a199a062 Stop using sqlite WITH RECURSIVE in our tests
The version of Python 3 running in Travis CI doesn't support this.
2017-11-13 14:15:21 -08:00
Simon Willison
d75f423b6f Release 0.9 0.9 2017-11-13 14:00:53 -08:00
Simon Willison
1e698787a4 Added --sql_time_limit_ms and --extra-options
The serve command now accepts --sql_time_limit_ms for customizing the SQL time
limit.

The publish and package commands now accept --extra-options which can be used
to specify additional options to be passed to the datasite serve command when
it executes inside the rusulting Docker containers.
2017-11-13 14:00:53 -08:00
Simon Willison
452c5f047e
Added Travis CI badge to README
Closes #77
2017-11-13 13:24:14 -08:00
Simon Willison
fe279ab7b4 v0.8 - added PyPI metadata, ready to ship 0.8 2017-11-13 13:17:34 -08:00
Simon Willison
847f3e0c92 Implemented offset/limit pagination for views
Closes #70
2017-11-13 13:10:55 -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
79216bac12 Added some breathing room to the footer 2017-11-13 11:38:20 -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
6b3b05b6db Released 0.7 0.7 2017-11-13 10:42:30 -08:00
Simon Willison
e838bd743d Added README and improved help for 'datasette serve' 2017-11-13 10:41:59 -08:00
Simon Willison
20d41c8e8e publish now takes a required publisher argument - only current option is 'now'
Closes #76
2017-11-13 10:40:51 -08:00
Simon Willison
4fec50597a Include license/source in JSON output if provided 2017-11-13 10:39:25 -08:00
Simon Willison
97c4bf4271 Added --cors argument to enable CORS
Closes #75
2017-11-13 10:17:42 -08:00
Simon Willison
495407acef Force initial .inspect() before starting server
Otherwise there is a long pause on the first request made.
2017-11-13 10:03:52 -08:00