{"html_url": "https://github.com/simonw/datasette/issues/1289#issuecomment-812767460", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1289", "id": 812767460, "node_id": "MDEyOklzc3VlQ29tbWVudDgxMjc2NzQ2MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-04-03T00:48:26Z", "updated_at": "2021-04-03T00:48:26Z", "author_association": "OWNER", "body": "On my Mac `pytest-xdist` ran the test suite (minus two tests) in 59s, as opposed to 2m23s without xdist.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 849543502, "label": "Speed up tests with pytest-xdist"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1289#issuecomment-812768915", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1289", "id": 812768915, "node_id": "MDEyOklzc3VlQ29tbWVudDgxMjc2ODkxNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-04-03T00:59:15Z", "updated_at": "2021-04-03T00:59:26Z", "author_association": "OWNER", "body": "Looks like `-n auto` only detected two cores on GitHub Actions: https://github.com/simonw/datasette/runs/2257597137?check_suite_focus=true\r\n```\r\n============================= test session starts ==============================\r\nplatform linux -- Python 3.7.10, pytest-6.2.2, py-1.10.0, pluggy-0.13.1\r\nSQLite: 3.31.1\r\nrootdir: /home/runner/work/datasette/datasette, configfile: pytest.ini\r\nplugins: xdist-2.2.1, timeout-1.4.2, forked-1.3.0, asyncio-0.14.0\r\ngw0 I / gw1 I\r\ngw0 [878] / gw1 [878]\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 849543502, "label": "Speed up tests with pytest-xdist"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1289#issuecomment-812803256", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1289", "id": 812803256, "node_id": "MDEyOklzc3VlQ29tbWVudDgxMjgwMzI1Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-04-03T03:29:25Z", "updated_at": "2021-04-03T03:29:25Z", "author_association": "OWNER", "body": "https://github.com/simonw/datasette/actions/runs/713207828 ran with `pytest-xdist` in 4m22s:\r\n\r\n\"Run_tests_in_CI_using_pytest-xdist__refs__1289_\u00b7_simonw_datasette_d63fc61\"\r\n\r\nHere's the test suite running on regular `pytest` in 5m13s:\r\n\r\n\"\u00a9_2017-2021_\u00b7_simonw_datasette_59ef4a2\"\r\n\r\nNot a huge speed-up because there are only 2 available cores in the GitHub Actions environment, but still worthwhile - especially since this lets people run in parallel on their own laptops.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 849543502, "label": "Speed up tests with pytest-xdist"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1290#issuecomment-812804178", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1290", "id": 812804178, "node_id": "MDEyOklzc3VlQ29tbWVudDgxMjgwNDE3OA==", "user": {"value": 22429695, "label": "codecov[bot]"}, "created_at": "2021-04-03T03:39:16Z", "updated_at": "2021-04-03T03:41:29Z", "author_association": "NONE", "body": "# [Codecov](https://codecov.io/gh/simonw/datasette/pull/1290?src=pr&el=h1) Report\n> Merging [#1290](https://codecov.io/gh/simonw/datasette/pull/1290?src=pr&el=desc) (2fb1e42) into [main](https://codecov.io/gh/simonw/datasette/commit/87b583a128986982552421d2510e467e74ac5046?el=desc) (87b583a) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/simonw/datasette/pull/1290/graphs/tree.svg?width=650&height=150&src=pr&token=eSahVY7kw1)](https://codecov.io/gh/simonw/datasette/pull/1290?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## main #1290 +/- ##\n=======================================\n Coverage 91.51% 91.51% \n=======================================\n Files 34 34 \n Lines 4255 4255 \n=======================================\n Hits 3894 3894 \n Misses 361 361 \n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/simonw/datasette/pull/1290?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `\u0394 = absolute (impact)`, `\u00f8 = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/simonw/datasette/pull/1290?src=pr&el=footer). Last update [87b583a...2fb1e42](https://codecov.io/gh/simonw/datasette/pull/1290?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 849568079, "label": "Use pytest-xdist to speed up tests"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/916#issuecomment-812804998", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/916", "id": 812804998, "node_id": "MDEyOklzc3VlQ29tbWVudDgxMjgwNDk5OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-04-03T03:47:45Z", "updated_at": "2021-04-03T03:47:45Z", "author_association": "OWNER", "body": "I found one example of an implementation of reversed keyset pagination here: https://github.com/tvainika/objection-keyset-pagination/blob/cb21a493c96daa6e63c302efae6718d09aa11661/index.js#L74-L79", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 672421411, "label": "Support reverse pagination (previous page, has-previous-items)"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/502#issuecomment-812813732", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/502", "id": 812813732, "node_id": "MDEyOklzc3VlQ29tbWVudDgxMjgxMzczMg==", "user": {"value": 5413548, "label": "louispotok"}, "created_at": "2021-04-03T05:16:54Z", "updated_at": "2021-04-03T05:16:54Z", "author_association": "CONTRIBUTOR", "body": "For what it's worth, if anyone finds this in the future, I was having the same issue. \r\n\r\nAfter digging through the code, it turned out that the database download is only available if it the db served in immutable mode, so `datasette serve -i xyz.db` rather than the doc's quickstart recommendation of `datasette serve xyz.db`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 453131917, "label": "Exporting sqlite database(s)?"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/916#issuecomment-812940457", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/916", "id": 812940457, "node_id": "MDEyOklzc3VlQ29tbWVudDgxMjk0MDQ1Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-04-03T23:28:40Z", "updated_at": "2021-04-03T23:28:40Z", "author_association": "OWNER", "body": "I think my ideal implementation for this would be to reverse the order, grab the previous page-size-plus-one items, then return a `?_next=x` token that would provide the previous page sorted back in the expected default order.\r\n\r\nThe alternative would be to have a `?_previous=x` token which can be used to paginate backwards in reverse order, but I think this would be confusing as it would result in \"hit next page, then hit previous page\" returning you to a new state which features rows in the reverse order.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 672421411, "label": "Support reverse pagination (previous page, has-previous-items)"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/916#issuecomment-812940907", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/916", "id": 812940907, "node_id": "MDEyOklzc3VlQ29tbWVudDgxMjk0MDkwNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-04-03T23:33:41Z", "updated_at": "2021-04-03T23:33:41Z", "author_association": "OWNER", "body": "Let's figure out the SQL for this. The most complex case is probably this one: https://latest.datasette.io/fixtures/compound_three_primary_keys?_next=a%2Ch%2Cr\r\n\r\nHere's the SQL for that page: https://latest.datasette.io/fixtures?sql=select+pk1%2C+pk2%2C+pk3%2C+content+from+compound_three_primary_keys+where+%28%28pk1+%3E+%3Ap0%29%0A++or%0A%28pk1+%3D+%3Ap0+and+pk2+%3E+%3Ap1%29%0A++or%0A%28pk1+%3D+%3Ap0+and+pk2+%3D+%3Ap1+and+pk3+%3E+%3Ap2%29%29+order+by+pk1%2C+pk2%2C+pk3+limit+101&p0=a&p1=h&p2=r\r\n\r\n```sql\r\nselect pk1, pk2, pk3, content from compound_three_primary_keys where ((pk1 > :p0)\r\n or\r\n(pk1 = :p0 and pk2 > :p1)\r\n or\r\n(pk1 = :p0 and pk2 = :p1 and pk3 > :p2)) order by pk1, pk2, pk3 limit 101\r\n```\r\nWhere `p0` is `a`, `p1` is `h` and `p2` is `r`.\r\n\r\nGiven the above, how would I figure out the correct previous link? It should be https://latest.datasette.io/fixtures/compound_three_primary_keys?_next=a%2Cd%2Cv - `a`, `d`, `v`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 672421411, "label": "Support reverse pagination (previous page, has-previous-items)"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/916#issuecomment-812941112", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/916", "id": 812941112, "node_id": "MDEyOklzc3VlQ29tbWVudDgxMjk0MTExMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-04-03T23:35:55Z", "updated_at": "2021-04-03T23:35:55Z", "author_association": "OWNER", "body": "I tried flipping the direction of the sort and the comparison operators and got this: https://latest.datasette.io/fixtures?sql=select+pk1%2C+pk2%2C+pk3%2C+content+from+compound_three_primary_keys+where+%28%28pk1+%3C+%3Ap0%29%0D%0A++or%0D%0A%28pk1+%3D+%3Ap0+and+pk2+%3C+%3Ap1%29%0D%0A++or%0D%0A%28pk1+%3D+%3Ap0+and+pk2+%3D+%3Ap1+and+pk3+%3C+%3Ap2%29%29+order+by+pk1+desc%2C+pk2+desc%2C+pk3+desc+limit+1+offset+99&p0=a&p1=h&p2=r\r\n\r\n```sql\r\nselect pk1, pk2, pk3, content from compound_three_primary_keys where ((pk1 < :p0)\r\n or\r\n(pk1 = :p0 and pk2 < :p1)\r\n or\r\n(pk1 = :p0 and pk2 = :p1 and pk3 < :p2)) order by pk1 desc, pk2 desc, pk3 desc limit 1 offset 99\r\n```\r\nWhich returned `a-d-v` as desired. I messed around with it to find the `limit 1 offset 99` values.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 672421411, "label": "Support reverse pagination (previous page, has-previous-items)"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/916#issuecomment-812941340", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/916", "id": 812941340, "node_id": "MDEyOklzc3VlQ29tbWVudDgxMjk0MTM0MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-04-03T23:38:37Z", "updated_at": "2021-04-03T23:38:37Z", "author_association": "OWNER", "body": "Same query again with `a, d, v` returns 0 results, which is also as we would want: it signifies that we are back to the very first page: https://latest.datasette.io/fixtures?sql=select+pk1%2C+pk2%2C+pk3%2C+content+from+compound_three_primary_keys+where+%28%28pk1+%3C+%3Ap0%29%0D%0A++or%0D%0A%28pk1+%3D+%3Ap0+and+pk2+%3C+%3Ap1%29%0D%0A++or%0D%0A%28pk1+%3D+%3Ap0+and+pk2+%3D+%3Ap1+and+pk3+%3C+%3Ap2%29%29+order+by+pk1+desc%2C+pk2+desc%2C+pk3+desc+limit+1+offset+99&p0=a&p1=d&p2=v", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 672421411, "label": "Support reverse pagination (previous page, has-previous-items)"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/916#issuecomment-812941818", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/916", "id": 812941818, "node_id": "MDEyOklzc3VlQ29tbWVudDgxMjk0MTgxOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-04-03T23:43:11Z", "updated_at": "2021-04-03T23:43:11Z", "author_association": "OWNER", "body": "Relevant code is some of the most complex in all of Datasette.\r\n\r\nhttps://github.com/simonw/datasette/blob/0a7621f96f8ad14da17e7172e8a7bce24ef78966/datasette/views/table.py#L530-L594\r\n\r\nAnd\r\n\r\nhttps://github.com/simonw/datasette/blob/0a7621f96f8ad14da17e7172e8a7bce24ef78966/datasette/views/table.py#L743-L771\r\n\r\nI'll need to think hard about how to refactor this out into something more understandable before implementing previous links.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 672421411, "label": "Support reverse pagination (previous page, has-previous-items)"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1287#issuecomment-812935384", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1287", "id": 812935384, "node_id": "MDEyOklzc3VlQ29tbWVudDgxMjkzNTM4NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-04-03T22:38:33Z", "updated_at": "2021-04-03T22:38:33Z", "author_association": "OWNER", "body": "https://twitter.com/llanga/status/1378431719934681094 looks like I should wait for 3.9.4, out in a few days.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 849396758, "label": "Upgrade to Python 3.9.4"}, "performed_via_github_app": null}