{"html_url": "https://github.com/simonw/datasette/issues/216#issuecomment-381786522", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/216", "id": 381786522, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MTc4NjUyMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-16T23:58:45Z", "updated_at": "2018-04-16T23:59:13Z", "author_association": "OWNER", "body": "Weird... tests are failing in Travis, despite passing on my local machine. https://travis-ci.org/simonw/datasette/builds/367423706", "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-381649437", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/216", "id": 381649437, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MTY0OTQzNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-16T15:39:21Z", "updated_at": "2018-04-16T15:39:21Z", "author_association": "OWNER", "body": "Here's where that SQL gets constructed at the moment:\r\n\r\nhttps://github.com/simonw/datasette/blob/10a34f995c70daa37a8a2aa02c3135a4b023a24c/datasette/app.py#L761-L771", "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-381649140", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/216", "id": 381649140, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MTY0OTE0MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-16T15:38:29Z", "updated_at": "2018-04-16T15:38:29Z", "author_association": "OWNER", "body": "But what would that SQL look like for `_sort_desc`?", "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-381648053", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/216", "id": 381648053, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MTY0ODA1Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-16T15:35:17Z", "updated_at": "2018-04-16T15:35:17Z", "author_association": "OWNER", "body": "I think the correct SQL is this: https://datasette-issue-189-demo-3.now.sh/salaries-7859114-7859114?sql=select+rowid%2C+*+from+%5B2017+Maryland+state+salaries%5D%0D%0Awhere+%28middle_initial+is+not+null+or+%28middle_initial+is+null+and+rowid+%3E+%3Ap0%29%29%0D%0Aorder+by+middle_initial+limit+101&p0=391\r\n\r\n```\r\nselect rowid, * from [2017 Maryland state salaries]\r\nwhere (middle_initial is not null or (middle_initial is null and rowid > :p0))\r\norder by middle_initial limit 101\r\n```\r\n\r\nThough this will also need to be taken into account for #198 ", "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-381645973", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/216", "id": 381645973, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MTY0NTk3Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-16T15:29:11Z", "updated_at": "2018-04-16T15:29:11Z", "author_association": "OWNER", "body": "I could use `$null` as a magic value that means None. Since I'm applying `quote_plus()` to actual values, any legit strings that look like this will be encoded as `%24null`:\r\n\r\n```\r\n>>> urllib.parse.quote_plus('$null')\r\n'%24null'\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-381645274", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/216", "id": 381645274, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MTY0NTI3NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-16T15:27:16Z", "updated_at": "2018-04-16T15:27:16Z", "author_association": "OWNER", "body": "Relevant code:\r\n\r\nhttps://github.com/simonw/datasette/blob/904f1c75a3c17671d25c53b91e177c249d14ab3b/datasette/app.py#L828-L832", "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-381644355", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/216", "id": 381644355, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MTY0NDM1NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-16T15:24:38Z", "updated_at": "2018-04-16T15:24:38Z", "author_association": "OWNER", "body": "So there are two tricky problems to solve here:\r\n\r\n* I need a way of encoding `null` into that `_next=` that is unambiguous from the string `None` or `null`. This means introducing some kind of escaping mechanism in those strings. I already use URL encoding as part of the construction of those components here, maybe that can help here?\r\n* I need to figure out what the SQL should be for the \"next\" set of results if the previous value was null. Thankfully we use the primary key as a tie-breaker so this shouldn't be impossible.", "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-381643173", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/216", "id": 381643173, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MTY0MzE3Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-16T15:21:17Z", "updated_at": "2018-04-16T15:21:17Z", "author_association": "OWNER", "body": "Yikes, definitely a bug.", "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}