{"html_url": "https://github.com/simonw/sqlite-utils/issues/282#issuecomment-864348954", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/282", "id": 864348954, "node_id": "MDEyOklzc3VlQ29tbWVudDg2NDM0ODk1NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-06-19T03:34:42Z", "updated_at": "2021-06-19T03:35:46Z", "author_association": "OWNER", "body": "I built some prototype code here for something which looks at every row in a CSV import and records the likely types: https://gist.github.com/simonw/465f9356f175d1cf86957947dff501d4\r\n\r\nThis could be used by the command-line tools to figure out what `table.transform(types=...)` method to use at the end.\r\n\r\nThis is a different approach to the pure SQL version I tried building in https://github.com/simonw/sqlite-utils/issues/179 - I think this is a better approach though, it's less prone to weird idiosyncrasies of SQLite types, and it's also easy for us to add on to the existing CSV import code in a way that won't require scanning the data twice.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 925305186, "label": "Automatic type detection for CSV data"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/282#issuecomment-864349123", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/282", "id": 864349123, "node_id": "MDEyOklzc3VlQ29tbWVudDg2NDM0OTEyMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-06-19T03:36:54Z", "updated_at": "2021-06-19T03:36:54Z", "author_association": "OWNER", "body": "I may change the default for `sqlite-utils insert` to detect types if I release `sqlite-utils` 4.0, as a backwards-incompatible change.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 925305186, "label": "Automatic type detection for CSV data"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/282#issuecomment-864350407", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/282", "id": 864350407, "node_id": "MDEyOklzc3VlQ29tbWVudDg2NDM1MDQwNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-06-19T03:52:20Z", "updated_at": "2021-06-19T03:52:20Z", "author_association": "OWNER", "body": "I'll have an environment variable for `--detect-types` so users who really want that as the default option can turn it on.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 925305186, "label": "Automatic type detection for CSV data"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/282#issuecomment-864354627", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/282", "id": 864354627, "node_id": "MDEyOklzc3VlQ29tbWVudDg2NDM1NDYyNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-06-19T04:42:03Z", "updated_at": "2021-06-19T04:42:03Z", "author_association": "OWNER", "body": "Demo:\r\n\r\n curl -s 'https://api.github.com/users/simonw/repos?per_page=100' | \\\r\n sqlite-utils memory - 'select sum(size), sum(stargazers_count) from stdin limit 1'\r\n [{\"sum(size)\": 2042547, \"sum(stargazers_count)\": 6769}]\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 925305186, "label": "Automatic type detection for CSV data"}, "performed_via_github_app": null}