{"html_url": "https://github.com/simonw/sqlite-utils/issues/351#issuecomment-987437043", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/351", "id": 987437043, "node_id": "IC_kwDOCGYnMM462xfz", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-07T00:41:02Z", "updated_at": "2021-12-07T00:41:56Z", "author_association": "OWNER", "body": "The fix there was:\r\n```diff\r\n@@ -463,7 +473,7 @@ def compile_convert(convert, imports):\r\n locals = {}\r\n globals = {\"json\": json}\r\n for import_ in imports:\r\n- globals[import_] = __import__(import_)\r\n+ globals[import_.split(\".\")[0]] = __import__(import_)\r\n exec(code_o, globals, locals)\r\n```\r\nWith this example (needs to be modified here):\r\n```\r\ngit-history file items.xml --convert '\r\ntree = xml.etree.ElementTree.fromstring(content)\r\nreturn [el.attrib for el in tree.iter(\"item\")]\r\n' --import xml.etree.ElementTree\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1072780607, "label": "Support `--import xml.etree.ElementTree` in `sqlite-utils convert`"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/352#issuecomment-987454872", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/352", "id": 987454872, "node_id": "IC_kwDOCGYnMM46212Y", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-07T00:56:29Z", "updated_at": "2021-12-07T00:56:29Z", "author_association": "OWNER", "body": "Thought about this due to this issue, which should stay consistent with how the `sqlite-utils` CLI works:\r\n\r\n- https://github.com/simonw/git-history/issues/41", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1072792507, "label": "`sqlite-utils insert --extract colname`"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/349#issuecomment-987458772", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/349", "id": 987458772, "node_id": "IC_kwDOCGYnMM4622zU", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-07T01:00:41Z", "updated_at": "2021-12-07T01:00:41Z", "author_association": "OWNER", "body": "I think the syntax design of this looks like:\r\n```python\r\nitem_pk = db[item_table].lookup(\r\n {\"_item_id\": item_id},\r\n item_to_insert,\r\n column_order=(\"_id\", \"_item_id\"),\r\n pk=\"_id\",\r\n indexes=(\"_version\",),\r\n)\r\n```\r\nSo it's a sequence of column names... or a sequence of tuples for creating compound indexes:\r\n```python\r\ndb[\"dogs\"].insert(\r\n {\"name\": \"Cleo\", \"species\": \"Mutt\", \"hobbies\": \"Raiding picnics\"},\r\n indexes=((\"name\", \"species\"), \"hobbies\"),\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": 1071531082, "label": "A way of creating indexes on newly created tables"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/349#issuecomment-987461427", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/349", "id": 987461427, "node_id": "IC_kwDOCGYnMM4623cz", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-07T01:03:43Z", "updated_at": "2021-12-07T01:04:37Z", "author_association": "OWNER", "body": "In terms of types, I think that means it looks like this:\r\n\r\n```python\r\nIndexesType = Iterable[\r\n Union[str, Iterable[str]]\r\n]\r\n\r\ndef create(\r\n self,\r\n columns: Dict[str, Any],\r\n pk: Optional[Any] = None,\r\n ...\r\n indexes: Optional[IndexesType] = None,\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": 1071531082, "label": "A way of creating indexes on newly created tables"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1527#issuecomment-988154238", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1527", "id": 988154238, "node_id": "IC_kwDOBm6k_c465gl-", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-07T18:05:26Z", "updated_at": "2021-12-07T18:05:26Z", "author_association": "OWNER", "body": "Found a new case of this bug: click the \"Apply\" button on https://latest.datasette.io/fixtures/facetable?_sort=pk&_city_id__gt=1\r\n\r\n![apply-bug](https://user-images.githubusercontent.com/9599/145082760-6947c769-480f-45c7-9916-b6cc7f5834f8.gif)\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": 1059555791, "label": "Columns starting with an underscore behave poorly in filters"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1544#issuecomment-988226523", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1544", "id": 988226523, "node_id": "IC_kwDOBm6k_c465yPb", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-07T20:02:00Z", "updated_at": "2021-12-07T20:02:00Z", "author_association": "OWNER", "body": "Here's the code at fault: https://github.com/simonw/datasette/blob/0a7621f96f8ad14da17e7172e8a7bce24ef78966/datasette/database.py#L288-L291", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1073712378, "label": "Code that detects the label column for a table is case-sensitive"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1544#issuecomment-988226938", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1544", "id": 988226938, "node_id": "IC_kwDOBm6k_c465yV6", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-07T20:02:44Z", "updated_at": "2021-12-07T20:02:44Z", "author_association": "OWNER", "body": "I'm feeling rushed today so I'm going to fix this without adding a test!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1073712378, "label": "Code that detects the label column for a table is case-sensitive"}, "performed_via_github_app": null}