{"html_url": "https://github.com/simonw/datasette/issues/2019#issuecomment-1421784930", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2019", "id": 1421784930, "node_id": "IC_kwDOBm6k_c5Uvrdi", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-02-08T01:28:25Z", "updated_at": "2023-02-08T01:40:46Z", "author_association": "OWNER", "body": "Rather than duplicate this rather awful hack:\r\n\r\nhttps://github.com/simonw/datasette/blob/0b4a28691468b5c758df74fa1d72a823813c96bf/datasette/views/table.py#L694-L714\r\n\r\nI'm tempted to say that the code that calls the new pagination helper needs to ensure that the `sort` or `sort_desc` columns are selected. If it wants to ditch them later (e.g. because they were not included in `?_col=`) it can do that later once the results have come back.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1573424830, "label": "Refactor out the keyset pagination code"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/1999#issuecomment-1421988953", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1999", "id": 1421988953, "node_id": "IC_kwDOBm6k_c5UwdRZ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-02-08T04:35:44Z", "updated_at": "2023-02-08T05:27:48Z", "author_association": "OWNER", "body": "Next step: get `?_next=...` working (it is ignored at the moment, even though the returned JSON includes the `\"next\"` key).\r\n\r\nThen... figure out how to render HTML and other requested formats.\r\n\r\nThen get the tests to pass!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1551694938, "label": "?_extra= support (draft)"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/262#issuecomment-1423067724", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/262", "id": 1423067724, "node_id": "IC_kwDOBm6k_c5U0kpM", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-02-08T18:33:32Z", "updated_at": "2023-02-08T18:36:48Z", "author_association": "OWNER", "body": "Just realized that it's useful to be able to tell what parameters were used to generate a page... but reflecting things like `_next` back in the JSON is confusing in the presence of `next`.\r\n\r\nSo I'm going to add an extra for that information too.\r\n\r\nNot sure what to call it though:\r\n\r\n- `params` - confusing because in the code that's usually used for params passed to SQL queries\r\n- `query_string` - wouldn't that be a string, not params as a dictionary?\r\n\r\nI'm going to experiment with a `request` extra that returns some bits of information about the request.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 323658641, "label": "Add ?_extra= mechanism for requesting extra properties in JSON"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/525#issuecomment-1423387341", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/525", "id": 1423387341, "node_id": "IC_kwDOCGYnMM5U1yrN", "user": {"value": 167893, "label": "mcarpenter"}, "created_at": "2023-02-08T23:48:52Z", "updated_at": "2023-02-09T00:17:30Z", "author_association": "CONTRIBUTOR", "body": "PR below", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1575131737, "label": "Repeated calls to `Table.convert()` fail"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/524#issuecomment-1422681850", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/524", "id": 1422681850, "node_id": "IC_kwDOCGYnMM5UzGb6", "user": {"value": 21095447, "label": "4l1fe"}, "created_at": "2023-02-08T14:25:50Z", "updated_at": "2023-02-08T14:29:09Z", "author_association": "NONE", "body": "I live the patch here for others:\r\n\r\n_original code_\r\n```shell\r\n$ which sqlite-utils | xargs cat\r\n```\r\n```python\r\n#!/usr/bin/python3\r\n# -*- coding: utf-8 -*-\r\nimport re\r\nimport sys\r\nfrom sqlite_utils.cli import cli\r\n\r\n\r\nif __name__ == '__main__':\r\n sys.argv[0] = re.sub(r'(-script\\.pyw|\\.exe)?$', '', sys.argv[0])\r\n sys.exit(cli())\r\n```\r\n\r\n_patched/sqlite-utils.py_\r\n```python\r\n#!/usr/bin/python3\r\n# -*- coding: utf-8 -*-\r\nimport re\r\nimport sys\r\nfrom sqlite_utils.cli import cli\r\n\r\n# New imports\r\nfrom unittest.mock import patch\r\nfrom sqlite_utils.cli import VALID_COLUMN_TYPES\r\n\r\n\r\nif __name__ == '__main__':\r\n # Choices of the option `--type`\r\n cli.commands['transform'].params[2].type.types[1].choices.append('DATETIME')\r\n\r\n # The dicts has to be extended with a new type\r\n with patch.dict('sqlite_utils.db.COLUMN_TYPE_MAPPING', {'DATETIME': 'DATETIME'}),\\\r\n patch('sqlite_utils.cli.VALID_COLUMN_TYPES', VALID_COLUMN_TYPES + (\"DATETIME\", )):\r\n\r\n # Command is unchanged\r\n sys.argv[0] = re.sub(r'(-script\\.pyw|\\.exe)?$', '', sys.argv[0])\r\n sys.exit(cli())\r\n```\r\n\r\nAnd now it's working\r\n```bash\r\n$ sqlite-utils schema events.sqlite cards.chunk.get\r\nCREATE TABLE \"cards.chunk.get\" (\r\n [id] INTEGER PRIMARY KEY NOT NULL,\r\n [timestamp] TEXT,\r\n)\r\n\r\n$ python patched/sqlite-utils.py transform events.sqlite cards.chunk.get --type timestamp DATETIME\r\n\r\n$ sqlite-utils schema events.sqlite cards.chunk.get\r\nCREATE TABLE \"cards.chunk.get\" (\r\n [id] INTEGER PRIMARY KEY NOT NULL,\r\n [timestamp] DATETIME,\r\n)\r\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": 1572766460, "label": "Transformation type `--type DATETIME`"}, "performed_via_github_app": null}