Wykres commitów

2519 Commity (9989f257094daaf26e0cb0cebe31f17f19d4cad2)

Autor SHA1 Wiadomość Data
Simon Willison c371f06fde Include took_ms in JSON output 2017-10-24 16:55:53 -07:00
Simon Willison 2a09d37087 Allow views to be browsed as well as tables 2017-10-24 16:55:08 -07:00
Simon Willison 02b1814fcf Redirects now preserve query string
Fixes #28
2017-10-24 16:54:26 -07:00
Simon Willison 5f806880c9 Correctly JSON serialize sqlite3.Cursor 2017-10-24 16:53:21 -07:00
Simon Willison bc9379aabc Added .jsono extension
Returns JSON key/value objects for each row instead of lists of values.

Closes #6
2017-10-24 08:07:52 -07:00
Simon Willison f643f7aee1 base64 encode bytestrings from DB in JSON
Fixes #29
2017-10-24 07:58:41 -07:00
Simon Willison b46e370ee6 Link to pages-per-row
Closes #1
2017-10-24 07:10:58 -07:00
Simon Willison 6a9fdcc071 Added addressable page per row
Refs #1 - only exists for tables with introspectable primary keys.

Still need to link to this page.

Also added first unit tests - refs #9
2017-10-23 22:54:58 -07:00
Simon Willison 606ff9e35e python app.py --build to generate build-metadata.json
This is now run by the Dockerfile to build this at compile time.
2017-10-23 22:53:13 -07:00
Simon Willison b20d7119e4 Implemented template inheritance and brought back errors 2017-10-23 19:56:27 -07:00
Simon Willison 0fa1772697 Allow ?sql= argument against database
e.g. /database-234324?sql=select * from table limit 1
2017-10-23 19:48:56 -07:00
Simon Willison 255e2611e5 CORS headers for JSON responses
Access-Control-Allow-Origin: *
2017-10-23 19:48:06 -07:00
Simon Willison 12f7e1dc56 Hashed URLs now have far-future cache expiry
Since the URL now includes a hash of the database, we can return a Cache-
Control: max-age=31536000 header for every response.

The exception is our 302 redirects. These we now serve with a Link: header
that tells any HTTP/2 server-push aware fronting proxies (such as Cloudfront)
to push the target of the redirect.

Closes #4
2017-10-23 19:36:44 -07:00
Simon Willison 9d21914069 Refactored to use class based views
Closes #22
2017-10-23 19:25:48 -07:00
Simon Willison b2372605d6 Implemented multi-db support plus initial URL structure
Refs #24

Fixes #15
2017-10-23 19:00:37 -07:00
Simon Willison 6a0c5de615 ensure_build_metadata() function for metadata
This will be run at compile time - the goal is to generate a build-
metadata.json file with a bunch of useful facts about the databases that could
be expensive to generate at run-time.

Example metadata:

    {
        "flights": {
        "file": "flights.db",
        "tables": {
            "airlines": 6048,
            "airports": 8107,
            "routes": 67663
        },
        "hash": "07d1283e07786b1235bb7041ea445ae103d1571565580a29eab0203c555725fd"
    }

So far we have a sha256 hash of the database file itself, plus a row count for
each table.

Fixes #11
2017-10-23 09:02:40 -07:00
Simon Willison f571b19d8a sqlerrors() decorator catching and returning useful errors
Closes #8
2017-10-23 08:28:00 -07:00
Simon Willison de04d7a854 Initial working proof of concept 2017-10-22 17:41:19 -07:00
Simon Willison ac9d66817d Initial commit 2017-10-22 17:39:03 -07:00