Wykres commitów

2446 Commity (1.0a.x)

Autor SHA1 Wiadomość Data
Simon Willison 45e502aace Added unit tests for inspect() foreign key detection
Used them to fix a bug with it.

Refs #85
2017-11-17 08:08:11 -08:00
Simon Willison e16ca1169c Refactored table column/row display logic
Simplified the template and made the way for upcoming foreign key work.

Refs #85

Also fixed   bug on database page - closes #113
2017-11-17 07:39:36 -08:00
Simon Willison 084350b0f1 Switched to gather_request=False for Sanic tests
Gets rid of those ugly _, response = lines.
2017-11-17 06:53:37 -08:00
Robert Gieseke eda848b37f Add keyboard shortcut to execute SQL query (#115) 2017-11-17 06:22:55 -08:00
Simon Willison f3445e2d13 Install python3-dev rothar than python-dev 2017-11-17 06:18:49 -08:00
Simon Willison 1a6cfcc10f Added a .dockerignore
Figured this would be useful while testing out 03572ae355
2017-11-17 06:18:23 -08:00
Simon Willison 03572ae355 Allow --load-extension to be set via environment variable
I tesed this by first building and running a container using the new
Dockerfile from #114:

    docker build .
    docker run -it -p 8001:8001 6c9ca7e29181 /bin/sh

Then I ran this inside the container itself:

    apt update && apt-get install wget -y \
        && wget http://www.gaia-gis.it/spatialite-2.3.1/test-2.3.sqlite.gz \
        && gunzip test-2.3.sqlite.gz \
        && mv test-2.3.sqlite test23.sqlite \
        && datasette -h 0.0.0.0 test23.sqlite

I visited this URL to confirm I got an error due to spatialite not being
loaded:

http://localhost:8001/test23-c88bc35?sql=select+ST_AsText%28Geometry%29+from+HighWays+limit+1

Then I checked that loading it with `--load-extension` worked correctly:

    datasette -h 0.0.0.0 test23.sqlite \
        --load-extension=/usr/lib/x86_64-linux-gnu/mod_spatialite.so

Then, finally, I tested it with the new environment variable option:

    SQLITE_EXTENSIONS=/usr/lib/x86_64-linux-gnu/mod_spatialite.so \
        datasette -h 0.0.0.0 test23.sqlite

Running it with an invalid environment variable option shows an error:

    $ SQLITE_EXTENSIONS=/usr/lib/x86_64-linux-gnu/blah.so datasette \
        -h 0.0.0.0 test23.sqlite
    Usage: datasette -h [OPTIONS] [FILES]...

    Error: Invalid value for "--load-extension": Path "/usr/lib/x86_64-linux-gnu/blah.so" does not exist.

Closes #112
2017-11-17 06:13:35 -08:00
Ray N ed2b3f25be add support for ?field__isnull=1 (#107)
* add support for ?field__isnull=1

* Add unit test and conditional formatting for ?field__isnull
2017-11-17 05:29:22 -08:00
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 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 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 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 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 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