{"html_url": "https://github.com/simonw/datasette/issues/14#issuecomment-381622793", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/14", "id": 381622793, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MTYyMjc5Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-16T14:40:39Z", "updated_at": "2018-04-17T01:47:15Z", "author_association": "OWNER", "body": "I think that's OK. The two plugins I've implemented so far (`prepare_connection` and `prepare_jinja2_environment`) both make sense if they can only be defined once-per-plugin. For the moment I'll assume I can define future hooks to work well with the same limitation.\r\n\r\nThe syntactic sugar idea in #220 can help here too.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 267707940, "label": "Datasette Plugins"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/216#issuecomment-381788051", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/216", "id": 381788051, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MTc4ODA1MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-17T00:07:48Z", "updated_at": "2018-04-17T00:07:48Z", "author_association": "OWNER", "body": "Still failing. This is very odd.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314665147, "label": "Bug: Sort by column with NULL in next_page URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/216#issuecomment-381794744", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/216", "id": 381794744, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MTc5NDc0NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-17T00:51:41Z", "updated_at": "2018-04-17T00:51:41Z", "author_association": "OWNER", "body": "I'm reverting this out of master until I can figure out why the tests are failing.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314665147, "label": "Bug: Sort by column with NULL in next_page URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/216#issuecomment-381798786", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/216", "id": 381798786, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MTc5ODc4Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-17T01:18:25Z", "updated_at": "2018-04-17T01:18:25Z", "author_association": "OWNER", "body": "Here's the test that's failing:\r\n\r\nhttps://github.com/simonw/datasette/blob/59a3aa859c0e782aeda9a515b1b52c358e8458a2/tests/test_api.py#L437-L470\r\n\r\nI got Travis to spit out the `fetched` and `expected` variables.\r\n\r\n`expected` has 201 items in it and is identical to what I get on my local laptop.\r\n\r\n`fetched` has 250 items in it, so it's clearly different from my local environment.\r\n\r\nI've managed to replicate the bug in production! I created a test database like this:\r\n\r\n python tests/fixtures.py sortable.db\r\n\r\nThen deployed that database like so:\r\n\r\n datasette publish now sortable.db \\\r\n --extra-options=\"--page_size=50\" --branch=debug-travis-issue-216\r\n\r\nAnd... if you click \"next\" on this page https://datasette-issue-216-pagination.now.sh/sortable-5679797/sortable?_sort_desc=sortable_with_nulls five times you get back 250 results, when you should only get back 201.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314665147, "label": "Bug: Sort by column with NULL in next_page URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/216#issuecomment-381799267", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/216", "id": 381799267, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MTc5OTI2Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-17T01:21:35Z", "updated_at": "2018-04-17T01:21:35Z", "author_association": "OWNER", "body": "The version that I deployed which exhibits the bug is running SQLite `3.8.7.1` - https://datasette-issue-216-pagination.now.sh/sortable-5679797?sql=select+sqlite_version%28%29\r\n\r\nThe version that I have running locally which does NOT exhibit the bug is running SQLite `3.23.0`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314665147, "label": "Bug: Sort by column with NULL in next_page URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/216#issuecomment-381799408", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/216", "id": 381799408, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MTc5OTQwOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-17T01:22:30Z", "updated_at": "2018-04-17T01:22:30Z", "author_association": "OWNER", "body": "... which is VERY surprising, because `3.23.0` only came out on 2nd April this year: https://www.sqlite.org/changes.html - I have no idea how I came to be running that version on my laptop.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314665147, "label": "Bug: Sort by column with NULL in next_page URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/216#issuecomment-381801302", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/216", "id": 381801302, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MTgwMTMwMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-17T01:33:43Z", "updated_at": "2018-04-17T01:33:43Z", "author_association": "OWNER", "body": "This is the SQL that returns differing results in production and on my laptop: https://datasette-issue-216-pagination.now.sh/sortable-5679797?sql=select+%2A+from+sortable+where+%28sortable_with_nulls+is+null+and+%28%28pk1+%3E+%3Ap0%29%0A++or%0A%28pk1+%3D+%3Ap0+and+pk2+%3E+%3Ap1%29%29%29+order+by+sortable_with_nulls+desc+limit+51&p0=b&p1=t\r\n\r\n```\r\nselect * from sortable where (sortable_with_nulls is null and ((pk1 > :p0)\r\n or\r\n(pk1 = :p0 and pk2 > :p1))) order by sortable_with_nulls desc limit 51\r\n```\r\nI think that `order by sortable_with_nulls desc` bit is at fault - the primary keys should be included in that order by as well.\r\n\r\nSure enough, changing the query to this one returns the same results across both environments:\r\n\r\n```\r\nselect * from sortable where (sortable_with_nulls is null and ((pk1 > :p0)\r\n or\r\n(pk1 = :p0 and pk2 > :p1))) order by sortable_with_nulls desc, pk1, pk2 limit 51\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314665147, "label": "Bug: Sort by column with NULL in next_page URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/216#issuecomment-381803157", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/216", "id": 381803157, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MTgwMzE1Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-17T01:45:24Z", "updated_at": "2018-04-17T01:45:24Z", "author_association": "OWNER", "body": "Fixed!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314665147, "label": "Bug: Sort by column with NULL in next_page URL"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/14#issuecomment-381809998", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/14", "id": 381809998, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MTgwOTk5OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-17T02:23:39Z", "updated_at": "2018-04-17T02:23:39Z", "author_association": "OWNER", "body": "I just shipped Datasette 0.19 with where I'm at so far: https://github.com/simonw/datasette/releases/tag/0.19", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 267707940, "label": "Datasette Plugins"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/209#issuecomment-381905593", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/209", "id": 381905593, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MTkwNTU5Mw==", "user": {"value": 45057, "label": "russss"}, "created_at": "2018-04-17T08:50:28Z", "updated_at": "2018-04-17T08:50:28Z", "author_association": "CONTRIBUTOR", "body": "I've added another commit which puts classes a class on each `` by default with its column name, and I've also made the PK column bold.\r\n\r\nUnfortunately the tests are still failing on 3.6, which is weird. I can't reproduce locally...", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314455877, "label": " Don't duplicate simple primary keys in the link column"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/214#issuecomment-382038613", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/214", "id": 382038613, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MjAzODYxMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-17T15:38:23Z", "updated_at": "2018-04-17T15:38:23Z", "author_association": "OWNER", "body": "I figured out the recipe for bundling static assets in a plugin: https://github.com/simonw/datasette-plugin-demos/commit/26c5548f4ab7c6cc6d398df17767950be50d0edf (and then `python3 setup.py bdist_wheel`)\r\n\r\nHaving done that, I ran `pip install ../datasette-plugin-demos/dist/datasette_plugin_demos-0.2-py3-none-any.whl` from my Datasette virtual environment and then did the following:\r\n\r\n```\r\n>>> import pkg_resources\r\n>>> pkg_resources.resource_stream(\r\n... 'datasette_plugin_demos', 'static/plugin.js'\r\n... ).read()\r\nb\"alert('hello');\\n\"\r\n>>> pkg_resources.resource_filename(\r\n... 'datasette_plugin_demos', 'static/plugin.js'\r\n... )\r\n'..../venv/lib/python3.6/site-packages/datasette_plugin_demos/static/plugin.js'\r\n>>> pkg_resources.resource_string(\r\n... 'datasette_plugin_demos', 'static/plugin.js'\r\n... )\r\nb\"alert('hello');\\n\"\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314506446, "label": "Ability for plugins to define extra JavaScript and CSS"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/214#issuecomment-382069980", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/214", "id": 382069980, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MjA2OTk4MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-17T17:08:28Z", "updated_at": "2018-04-17T17:08:28Z", "author_association": "OWNER", "body": "Even if we automatically serve ALL `static/` content from installed plugins, we'll still need them to register which files need to be linked to from `extra_css_urls` and `extra_js_urls`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 314506446, "label": "Ability for plugins to define extra JavaScript and CSS"}, "performed_via_github_app": null}