Using the (undocumented in the Python docs) fact that if you return 1 from a
set_progress_handler callback, SQLite will cancel the current query.
Closes#35
Expecting SQLite columns to all be valid utf8 doesn't work, because we are
deailing with all kinds of databases. Instead, we now use the 'replace'
encoding mode to replace any non-UTF8 characters with a [X] character.
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
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