commits

1,867 rows sorted by committer_date

View and edit SQL

Suggested facets: raw_committer, committer, author_date (date), committer_date (date)

sha message author_date committer_date ▼ raw_author raw_committer repo author committer
ac9d66817d6a08b806f8e4bc16da02fbdb430496 Initial commit 2017-10-23T00:39:03Z 2017-10-23T00:39:03Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 GitHub cd792325681cbad9f663f2879d8b69f1edbb678f datasette 107914493 simonw 9599 web-flow 19864447
de04d7a854d71003ffcf98028eab976a936c2dba Initial working proof of concept 2017-10-23T00:41:19Z 2017-10-23T00:41:19Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
f571b19d8a5fd3a19fdf679421fd55a8edbf5295 sqlerrors() decorator catching and returning useful errors Closes #8 2017-10-23T15:28:00Z 2017-10-23T15:28:00Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
6a0c5de6154893eb4269dc7b1f160726ec6395f2 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-23T16:02:40Z 2017-10-23T16:02:40Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
b2372605d63248f422b6e67cb5c392236a3aa612 Implemented multi-db support plus initial URL structure Refs #24 Fixes #15 2017-10-24T02:00:37Z 2017-10-24T02:00:37Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
9d219140694551453bfa528e0624919eb065f9d6 Refactored to use class based views Closes #22 2017-10-24T02:25:48Z 2017-10-24T02:25:48Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
12f7e1dc5624d14f644abead18bd90b420b6d97e 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-24T02:36:44Z 2017-10-24T02:36:44Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
255e2611e5c3cfdda76c9da7abdbe5af976044ac CORS headers for JSON responses Access-Control-Allow-Origin: * 2017-10-24T02:48:06Z 2017-10-24T02:48:06Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
0fa177269767e5e55c863382333fde627d2b7074 Allow ?sql= argument against database e.g. /database-234324?sql=select * from table limit 1 2017-10-24T02:48:56Z 2017-10-24T02:48:56Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
b20d7119e4f6506cdb9d5d11322e28130823adfd Implemented template inheritance and brought back errors 2017-10-24T02:56:27Z 2017-10-24T02:56:27Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
606ff9e35e007ae58a491d417f47779034bacabc python app.py --build to generate build-metadata.json This is now run by the Dockerfile to build this at compile time. 2017-10-24T05:53:13Z 2017-10-24T05:53:13Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
6a9fdcc0718aea2cbc01ae4d60b9a1fba3601a66 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-24T05:54:58Z 2017-10-24T05:54:58Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
b46e370ee6126aa2fa85cf789a31da38aed98496 Link to pages-per-row Closes #1 2017-10-24T14:10:58Z 2017-10-24T14:10:58Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
f643f7aee1b3d29df82b93a6560887a35b7a2f13 base64 encode bytestrings from DB in JSON Fixes #29 2017-10-24T14:58:41Z 2017-10-24T14:58:41Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
bc9379aabcedce7fbc661ac15008d8801199a045 Added .jsono extension Returns JSON key/value objects for each row instead of lists of values. Closes #6 2017-10-24T15:07:52Z 2017-10-24T15:07:52Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
5f806880c9766daf09fc9535171637ebb8224cab Correctly JSON serialize sqlite3.Cursor 2017-10-24T23:53:21Z 2017-10-24T23:53:21Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
02b1814fcfdc61b1b69b5955f2b60252ff10cde9 Redirects now preserve query string Fixes #28 2017-10-24T23:54:26Z 2017-10-24T23:54:26Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
2a09d3708777116daedc548078a662086552523f Allow views to be browsed as well as tables 2017-10-24T23:55:08Z 2017-10-24T23:55:08Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
c371f06fdea413cfb00aa8f81b7a5535a7ecdbc4 Include took_ms in JSON output 2017-10-24T23:55:53Z 2017-10-24T23:55:53Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
4c7379a898df426af0c31159e5cb06d672189301 Don't crash on weird character encodings 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. 2017-10-25T00:01:34Z 2017-10-25T00:01:34Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
1ae8ea0f03cfb9f25b1e25f3194c456c3649789c Started implementing ?name__contains=X filters So far we support __contains=, __startswith=, __endswith= and __exact= Refs #23 2017-10-25T00:06:23Z 2017-10-25T00:06:23Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
eef213ab4d57622dfc60c8655c0c7a18afcc844f Show total number of rows in table 2017-10-25T00:11:36Z 2017-10-25T00:11:36Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
3eb79e1a5fa4c164a224ae0adbe0ea16fde35758 Show total row count at top of table page 2017-10-25T01:31:43Z 2017-10-25T01:31:43Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
bd5f3b2ba1a627383d512d613b77d15501dfccc4 Show time taken at bottom of table page 2017-10-25T01:31:54Z 2017-10-25T01:31:54Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
2fe94641b0b2dc291d1fce3dad0fbf96294b3a32 Don't try to show row counts for views Also handle tables/views with spaces in their name in the URL. 2017-10-25T01:33:12Z 2017-10-25T01:33:12Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
6823b094066c5cb1dcd3581da2ed877ed72298b7 Set time limit of 1000ms on SQL queries 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 2017-10-25T01:34:54Z 2017-10-25T01:34:54Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
630b40038ef31b351abc2e39c3a0c7b3648814f8 Added support for gt, gte, lt, lte lookups Refs #23 2017-10-25T01:46:49Z 2017-10-25T01:46:55Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
1c5977961f596dae5aaa18c8b2d7a10e9f42a543 Added glob and like lookups - refs #23 2017-10-25T01:53:01Z 2017-10-25T01:53:01Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
e55bc3b2fa6e1e8be7b7c1f5b6cb3764713b6faa th align left for all tables 2017-10-25T14:46:38Z 2017-10-25T14:46:38Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
d94d4465d7e72e668122f81206397f4f20cf555b Double quote around column names This means filters still work even with column names that contain spaces 2017-10-25T14:47:20Z 2017-10-25T14:47:20Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
f1b0521810bbc467721e4dcc5a2ff1bf2a1ddbb8 Preserve .json through redirects 2017-10-25T15:01:22Z 2017-10-25T15:01:22Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
3cce63b59851495b6d9d38936356e21ea8fbad3a URL to allow direct database download It's just the database URL with .db on the end, e.g. /flights.db Closes #19 2017-10-25T15:19:32Z 2017-10-25T15:19:32Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
2a9799bae651558a23ae5074edad7cc13ff0fbdc Implemented database summary on index page Closes #41 2017-10-27T04:05:13Z 2017-10-27T04:05:17Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
1592fd0419f374de201926d3ba67fbf1522eed13 Started work on cli, which also meant adding setup.py I'm using click, and click recommends using a setup.py - so I've added one of those. I also refactored code into a new datasite package. It's not quite deploying to now properly at the moment though - I seem to have messed up the path handling a bit. Also snuck in a new template for the "Row" view. Refs #40 2017-10-27T07:08:24Z 2017-10-27T07:08:24Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
2c625e31ed018f929223918240603bf2a80e665c Fixed bug on Row page with tables containing spaces We were attempting to run this SQL: select * from "Order%20Details" where ... On this page: http://0.0.0.0:8877/northwind-40d049b/Order%20Details/10250,41 2017-10-27T07:16:18Z 2017-10-27T07:16:18Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
be768f26d09fa060b1ca71785ff546dd572f3fbc python setup.py test now runs the tests 2017-11-04T23:40:27Z 2017-11-04T23:40:27Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
edaa10587e60946e0c1935333f6b79553db33798 Configured Travis CI 2017-11-04T23:47:46Z 2017-11-04T23:47:46Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
0ac8bbce2e73c0759ec48661a7b740d2c368b2a2 Default subcommand is now serve Using click-default-group: https://github.com/click-contrib/click-default-group Also removed requirements.txt in favour of setup.py 2017-11-04T23:53:50Z 2017-11-04T23:53:50Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
1fc75809a6aa17860944b4cc3a4d7175cd53b1f4 Refactored everything into a factory function I now call a factory function to construct the Sanic app: app = app_factory(files) This allows me to pass additional arguments to it, e.g. the files to serve. Also refactored my class-based views to accept jinja as an argument, e.g: app.add_route( TableView.as_view(jinja), '/<db_name:[^/]+>/<table:[^/]+?><as_json:(.jsono?)?$>' ) 2017-11-05T02:13:44Z 2017-11-05T02:13:44Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
31b21f5c5e15fc3acab7fabb170c1da71dc3c98c Moved all SQLite queries to threads SQLite operations are blocking, but we're running everything in Sanic, an asyncio web framework, so blocking operations are bad - a long-running DB operation could hold up the entire server. Instead, I've moved all SQLite operations into threads. These are managed by a concurrent.futures ThreadPoolExecutor. This means I can run up to X queries in parallel, and I can continue to queue up additional incoming HTTP traffic while the threadpool is busy. Each thread is responsible for managing its own SQLite connections - one per database. These are cached in a threadlocal. Since we are working with immutable, read-only SQLite databases it should be safe to share SQLite objects across threads. On this assumption I'm using the check_same_thread=False option. Opening a database connection looks like this: conn = sqlite3.connect( 'file:filename.db?immutable=1', uri=True, check_same_thread=False, ) The following articles were helpful in figuring this out: * https://pymotw.com/3/asyncio/executors.html * https://marlinux.wordpress.com/2017/05/19/python-3-6-asyncio-sqlalchemy/ Closes #45. Refs #38. 2017-11-05T02:21:44Z 2017-11-05T02:21:44Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
186c513a61a091b9f83d788e25b08f41a84ed9a3 Support parameterized SQL and block potentially harmful queries You can now call arbitrary SQL like this: /flights?sql=select%20*%20from%20airports%20where%20country%20like%20:c&c=iceland Unescaped, those querystring params look like this: sql = select * from airports where country like :c c = iceland So SQL can be constructed with named parameters embedded in it, which will then be read from the querystring and correctly escaped. This means we can aggressively filter the SQL parameter for potentially dangerous syntax. For the moment we enforce that it starts with a SELECT statement and we ban the sequence "pragma" from it entirely. If you need to use pragma in a query, you can use the new named parameter mechanism. Fixes #39 2017-11-05T02:49:18Z 2017-11-05T02:49:18Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
a0bb9da17fb95ac5e3bcd3c8d800d33c25a71bbc Now requires DB files to be passed as arguments Refs #40 2017-11-06T02:24:43Z 2017-11-06T02:24:43Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
25c241fa5a0f8868e3c1bc5be4f5888caa47d864 Renamed project to immutabase 2017-11-06T02:32:13Z 2017-11-06T02:32:13Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
9e9e9613907b6a2a8a051fdda93c0d26344ee110 Fixed error in RowView 2017-11-06T02:38:06Z 2017-11-06T02:38:06Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
7e0cedae3d920797f6f9411aea90a2b1d86ac9c7 Now using bootstrap 4 beta Refs #16 2017-11-06T02:49:07Z 2017-11-06T02:49:07Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
8af7bc100c681975894f49f4ffd6d26a06e93f60 Added a MANIFEST.in Now python setup.py bdist_wheel creates a .whl that includes the CSS. 2017-11-09T02:39:42Z 2017-11-09T02:39:42Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
abb591d83264bbf11a5eb9daf03011d051e8f833 Added --reload argument to 'immutabase serve' command Uses hupper to restart the server when the code changes. Useful for development. Depends on https://pypi.python.org/pypi/hupper 2017-11-09T13:46:16Z 2017-11-09T14:14:26Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
b2dee11fcd989d9e2a7bf4de1e23dbc320c05013 Databases now get distinct colours A left border based on their content hash. Closes #31 2017-11-09T14:12:42Z 2017-11-09T14:14:40Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
d9fa2bf7ba2f9d3dcb2beb303f772c86344b4bcf Use rowid if no primary key available Allows us to link to individual records even for tables that do not have a primary key. Refs #5 2017-11-09T14:39:50Z 2017-11-09T14:39:50Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
bc9871c93583f3cdcca191b7fa05b255be7275c8 gt/lt/gte/lte now treat numeric arguments as numeric This now works: https://immutabase-dlmggyoepw.now.sh/northwind-40d049b/Products?UnitsInStock__gt=100 Previously the input value of 100 would be treated as a string. Also fixed a bug where filter arguments had stopped working entirely. Refs #23 2017-11-09T16:09:55Z 2017-11-09T16:09:55Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
292f140a4f391f646ec0be85ec9f22dde30f9de2 Explicitly order by pk (or by rowid) Refs #5 2017-11-09T16:11:14Z 2017-11-09T16:11:14Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
e7e50875d341f1d26b4dbba862f5202631f34896 Renamed to 'datasette' 2017-11-10T18:38:35Z 2017-11-10T18:38:35Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
e06b0117711ca7c9d6d6865d2bff8525aa11ebf0 Updated tests Refs #23 2017-11-10T18:43:54Z 2017-11-10T18:43:54Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
40d3b3eae68286f67e40226f18f2621b26e5e533 Refactored tests into new tests/ folder Guided by https://docs.pytest.org/en/latest/goodpractices.html 2017-11-10T18:48:16Z 2017-11-10T18:48:16Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
03c58fb350f6b9bb941a46907da5ac6f67bf47cf Show databases in alphabetical order on index page 2017-11-10T19:04:56Z 2017-11-10T19:04:56Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
1c57bd202fb1f82e14c47dfca63454352999732c Replaced app_factory with new Datasette class This should make it easier to add unit tests. 2017-11-10T19:05:57Z 2017-11-10T19:05:57Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
a8a293cd71f7529aff374be5ca01f2ebd5e71ee4 Refactored util functions into new utils module 2017-11-10T19:25:54Z 2017-11-10T19:25:54Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
e9fce441956642bef3548e3181d72a88317efa65 Don't serve cache headers in debug or refresh modes 2017-11-10T20:26:37Z 2017-11-10T20:26:37Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
21c9c04310dffcdb8cf6fee0f74fc9e7ac1ecf19 Implemented cursor-based pagination for table view Closes #5 2017-11-10T20:41:14Z 2017-11-10T20:41:14Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
7d81083d40fb2749be897d89c9a094d6521ef20c 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-11T05:55:50Z 2017-11-11T05:55:50Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
65e350ca2a4845c25752a62c16ba58cfe2c14b9b Implemented 'datasette publish one.db two.db' command Closes #26 2017-11-11T07:25:22Z 2017-11-11T07:25:22Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
3863a30b5d18204b4c77518f1880a1f705e929db publish command checks 'now' is installed Closes #58 2017-11-11T16:00:00Z 2017-11-11T16:00:00Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
3280972c891633c6015fa55bbfd094420b4f0233 Fixed tests I broke earlier Broke these tests in 21c9c04310dffcdb8cf6fee0f74fc9e7ac1ecf19 2017-11-11T16:52:17Z 2017-11-11T16:52:17Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
407795b61217205625f2d4e084afbf69f1db781b Initial unit tests against our Sanic app Refs #50 I had to disable the build metadata function to get these tests to work sensibly. I need to completely rethink how that mechanism works. 2017-11-11T17:47:59Z 2017-11-11T17:47:59Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
ad8b5d3bd23a7b306b8843d7de53a7c918ddb74f JSON version of our homepage Now available at http://localhost:8006/.json Tested by tests added in 407795b61217205625f2d4e084afbf69f1db781b 2017-11-11T17:49:47Z 2017-11-11T17:49:47Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
40a563ebac72f46a1b2dc498a25520c429bca6d6 Reworked metadata building options Building metadata is now optional. If you want to do it, do this: datasette build *.db --metadata=metadata.json Then when you run the server you can tell it to read from metadata: datasette serve *.db --metadata=metadata.json The Dockerfile generated by datasette publish now uses this mechanism. Closes #60 2017-11-11T20:10:51Z 2017-11-11T20:11:51Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
e4bf66d9b075190bf96c1f85eaccd7464915f249 Added header with breadcrumbs and footer Also cleaned up titles on various pages. Closes #61 2017-11-11T20:36:20Z 2017-11-11T20:36:20Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
e9e1def4c0cc49c96ed0b0d2bbc3ae81353ed2bb Revised JSON design a bit Closes #63 2017-11-11T22:20:00Z 2017-11-11T22:20:00Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
fa42a56c6a0fa62529eabf2d363bd3008ce23094 Bulked out table test a bit I'm closing #50 - more tests will be added in the future, but the framework is neatly in place for them now. 2017-11-11T22:22:47Z 2017-11-11T22:22:47Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
2366a016f252f2220eb777938a9da4b0de179063 Added links to .json and .jsono representations Closes #62 2017-11-11T22:40:44Z 2017-11-11T22:40:44Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
fd3a33989aaf2533c4928de3b251c24614003f1e Implemented new database view and template Closes #53 - see comments there for screenshots. 2017-11-12T01:50:21Z 2017-11-12T01:50:21Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
59580d02da80eb963d5bce897c539c6489042025 Implemented custom SQL via textarea Closes #65 2017-11-12T02:35:35Z 2017-11-12T02:35:35Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
b51836f8463ef65bc947f0a7b6e60167cb7154cf Fixed bug with tables with spaces in their name The new database index page was erroring. 2017-11-12T20:02:45Z 2017-11-12T20:02:45Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
8acdc2fd14c0f7251e1e3fd592c53b3152f5256c Test for table with space in name Tests code in b51836f8463ef65bc947f0a7b6e60167cb7154cf 2017-11-12T20:08:32Z 2017-11-12T20:08:32Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
f4794df07032083fbd3d4829e17b3fd2a54b779a Added border-right to table cells 2017-11-12T20:19:18Z 2017-11-12T20:19:18Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
ff2ab9dc7d82f70daae10f5b0cde87d74704f910 Views now show their SQL, are handled a bit better Refs #66 2017-11-12T20:31:46Z 2017-11-12T20:32:25Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
666aa032530189d585dd61d0e9851e9fe63ee598 Improved error handling Invalid SQL now shows a special error.html template, and is covered by tests. 2017-11-12T21:16:15Z 2017-11-12T21:16:15Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
22851ed9f0541904f5c3fca7ddbd7add10a75d39 Table page now shows CREATE TABLE at bottom Closes #66 2017-11-12T21:16:59Z 2017-11-12T21:16:59Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
59a616ca5c99301a254d86ab097b6ce8f7b30fb6 Move view SQL to bottom of the page Now consistent with tables 2017-11-12T21:25:34Z 2017-11-12T21:25:34Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
db3fa4abfac366184e97fb313b36d3429e5b937a Views no longer attempt to link to records Closes #54 2017-11-12T21:29:26Z 2017-11-12T21:29:26Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
efecae5a11617eb576d475192384339fcdb03189 Full path to database now works e.g. datasette /tmp/blah.db Previously this failed because it did not open with full path. 2017-11-12T22:23:41Z 2017-11-12T23:01:29Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
4c66097d581c3970a23530598c4fe98b09f422ee datasette publish now works with full paths e.g. datasette publish /tmp/blah/database.db now does the right thing 2017-11-12T23:16:24Z 2017-11-12T23:16:24Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
26370b14d862a5d2dc32b858bdf627f2a5ec3209 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-12T23:17:00Z 2017-11-12T23:17:00Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
d01370f1660d0b0360248105cd43060dca31f70f Show SQL and params if table has them applied 2017-11-12T23:21:39Z 2017-11-12T23:21:39Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
2bbe9ca34a701191e3bf4e97943b7503a50ab548 Support OPTIONS requests for CORS 2017-11-13T02:11:52Z 2017-11-13T02:11:52Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
ff2fb573cd8773206a6df83229620928056e2ee2 datasette publish --name=now-accepts-name Fixes #72 2017-11-13T02:12:21Z 2017-11-13T02:12:21Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
3ef35ca8b4369af6a8bcdd9e5cfbb5f3a7d17cf8 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-13T15:20:02Z 2017-11-13T15:20:02Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
4143e3b45c16cbae5e3e3419ef479a71810e7df3 New command: datasette package - packages a docker container Example usage: datasette package fivethirtyeight.db \ --tag fivethirtyeight \ --metadata=538-metadata.json This will create a temporary directory, generate a Dockerfile, copy in the SQLite database and metadata file, then build that as a new docker image and tag that in your local Docker repository as fivethirtyeight:latest. You can then run the image like so: docker run -p 8006:8001 fivethirtyeight This will expose port 8001 in the container (the default) as port 8006 on your host. Closes #67 2017-11-13T16:13:38Z 2017-11-13T16:17:35Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
495407acefe1e6976316aef88ae0e4c1d48ab421 Force initial .inspect() before starting server Otherwise there is a long pause on the first request made. 2017-11-13T18:03:52Z 2017-11-13T18:03:52Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
97c4bf4271495f8f711926ec44d8def3f2941379 Added --cors argument to enable CORS Closes #75 2017-11-13T18:17:42Z 2017-11-13T18:17:42Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
4fec50597a8684756bc96d4a69b6fab809ec6cf6 Include license/source in JSON output if provided 2017-11-13T18:39:25Z 2017-11-13T18:39:25Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
20d41c8e8e84ab3e8bdb5cca9bd9799da09794ad publish now takes a required publisher argument - only current option is 'now' Closes #76 2017-11-13T18:40:51Z 2017-11-13T18:40:51Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
e838bd743d31358b362875854a0ac5e78047727f Added README and improved help for 'datasette serve' 2017-11-13T18:41:53Z 2017-11-13T18:41:59Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
6b3b05b6db0d2a7b7cec8b8dbb4ddc5e12a376b2 Released 0.7 2017-11-13T18:42:30Z 2017-11-13T18:42:30Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
8252e71da461c425e625e1c3e4ee0bd92ea4cbf0 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-13T19:33:01Z 2017-11-13T19:33:01Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
79216bac12668eb90ccad65086d4f129476a3969 Added some breathing room to the footer 2017-11-13T19:38:20Z 2017-11-13T19:38:20Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
d76412668f8c12572eb7de57ccb72f1e50306177 Removed rogue middot 2017-11-13T20:34:39Z 2017-11-13T20:34:39Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
7dac1c05cd40f89a5af34763e4d5614c750575c2 Improved pagination Closes #78 2017-11-13T20:34:56Z 2017-11-13T20:34:56Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
847f3e0c92b5ac17200b2090bedcc5443bb08e4b Implemented offset/limit pagination for views Closes #70 2017-11-13T21:10:55Z 2017-11-13T21:10:55Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599
fe279ab7b4ae99dab295d5cf4d39ad06d782997e v0.8 - added PyPI metadata, ready to ship 2017-11-13T21:17:34Z 2017-11-13T21:17:34Z Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 Simon Willison 2946d096d0cdefdc017559e6b57e87658736e843 datasette 107914493 simonw 9599 simonw 9599

Next page

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [commits] (
   [sha] TEXT PRIMARY KEY,
   [message] TEXT,
   [author_date] TEXT,
   [committer_date] TEXT,
   [raw_author] TEXT REFERENCES [raw_authors]([id]),
   [raw_committer] TEXT REFERENCES [raw_authors]([id]),
   [repo] INTEGER REFERENCES [repos]([id]),
   [author] INTEGER REFERENCES [users]([id]),
   [committer] INTEGER REFERENCES [users]([id])
);
CREATE INDEX [idx_commits_committer]
                ON [commits] ([committer]);
CREATE INDEX [idx_commits_author]
                ON [commits] ([author]);
CREATE INDEX [idx_commits_repo]
                ON [commits] ([repo]);
CREATE INDEX [idx_commits_raw_committer]
                ON [commits] ([raw_committer]);
CREATE INDEX [idx_commits_raw_author]
                ON [commits] ([raw_author]);
Powered by Datasette · Query took 81.939ms · About: github-to-sqlite