{"html_url": "https://github.com/simonw/sqlite-utils/issues/355#issuecomment-991395494", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/355", "id": 991395494, "node_id": "IC_kwDOCGYnMM47F36m", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-11T00:50:22Z", "updated_at": "2021-12-11T00:51:15Z", "author_association": "OWNER", "body": "Here's an example of the new (slightly confusing) error message:\r\n```bash\r\nsqlite-utils convert fixtures.db roadside_attractions name '\r\ndef foo(value) \r\n bar\r\n baz\r\n'\r\nError: Syntax error in code:\r\n\r\n def foo(value)\r\n\r\ninvalid syntax\r\n```\r\nAnother:\r\n```\r\nsqlite-utils convert fixtures.db roadside_attractions name '$'\r\nError: Syntax error in code:\r\n\r\n return $\r\n\r\ninvalid syntax\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1077322009, "label": "Allow users to pass a full convert() function definition"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/355#issuecomment-991393684", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/355", "id": 991393684, "node_id": "IC_kwDOCGYnMM47F3eU", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-11T00:42:19Z", "updated_at": "2021-12-11T00:49:49Z", "author_association": "OWNER", "body": "Ideally I'd like to show the perfect syntax error messages to the user - but I don't know if it's possible to do this cleanly because the error might occur with their originally entered code OR it might occur after I add `def fn(value)` to it.\r\n\r\nI'm going to punt on that for the moment and tolerate slightly confusing syntax errors.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1077322009, "label": "Allow users to pass a full convert() function definition"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/355#issuecomment-991386841", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/355", "id": 991386841, "node_id": "IC_kwDOCGYnMM47F1zZ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-11T00:14:11Z", "updated_at": "2021-12-11T00:15:15Z", "author_association": "OWNER", "body": "Relevant code: https://github.com/simonw/sqlite-utils/blob/7a43af232e4bc00bd227307665163614e225948b/sqlite_utils/cli.py#L2128-L2135\r\n\r\nOne way to implement this would be to look to see if the code starts with `def ...` - but that's not going to work for proper module that start with a docstring or imports.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1077322009, "label": "Allow users to pass a full convert() function definition"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/355#issuecomment-991387044", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/355", "id": 991387044, "node_id": "IC_kwDOCGYnMM47F12k", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-11T00:14:45Z", "updated_at": "2021-12-11T00:14:45Z", "author_association": "OWNER", "body": "Maybe attempt to compile their code, and if it fails try again after adding `def fn(value):` to the start?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1077322009, "label": "Allow users to pass a full convert() function definition"}, "performed_via_github_app": null}