{"html_url": "https://github.com/simonw/sqlite-utils/issues/251#issuecomment-807647791", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/251", "id": 807647791, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNzY0Nzc5MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-25T22:42:48Z", "updated_at": "2021-03-25T22:44:31Z", "author_association": "OWNER", "body": "Idea: enhance `lambda` to allow it to return a dictionary of values, which will then be used to populate new columns. Use a `--multicolumn` option to indicate this:\r\n\r\n sqlite-utils convert lambda mydb.db mytable mycolumn \\\r\n --code '{\"first_name\": value.split()[0], \"last_name\": value.split()[1]}' \\\r\n --multicolumn --drop\r\n\r\nThe `--drop` means \"drop the `mycolumn` column after making this change\".\r\n\r\nMaybe `--multi` is a better name than `--multicolumn` here, since either way it's going to need additional explanation somewhere.\r\n\r\nWould this overlap with #239 at all?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 841377702, "label": "\"sqlite-utils convert\" command to replace the separate \"sqlite-transform\" tool"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/251#issuecomment-807642041", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/251", "id": 807642041, "node_id": "MDEyOklzc3VlQ29tbWVudDgwNzY0MjA0MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-03-25T22:39:22Z", "updated_at": "2021-03-25T22:39:22Z", "author_association": "OWNER", "body": "Here's the full current implementation of that tool: https://github.com/simonw/sqlite-transform/blob/0.5/sqlite_transform/cli.py\r\n\r\nMy current plan is to make this functionality available as the following:\r\n\r\n sqlite-utils convert jsonsplit mydb.db mytable mycolumn\r\n sqlite-utils convert parsedatetime mydb.db mytable mycolumn\r\n sqlite-utils convert parsedate mydb.db mytable mycolumn\r\n sqlite-utils convert lambda mydb.db mytable mycolumn --code='str(value).upper()'\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": 841377702, "label": "\"sqlite-utils convert\" command to replace the separate \"sqlite-transform\" tool"}, "performed_via_github_app": null}