{"html_url": "https://github.com/simonw/sqlite-utils/issues/92#issuecomment-599125455", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/92", "id": 599125455, "node_id": "MDEyOklzc3VlQ29tbWVudDU5OTEyNTQ1NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-03-14T19:34:35Z", "updated_at": "2020-03-14T19:34:35Z", "author_association": "OWNER", "body": "From https://www.sqlite.org/datatype3.html it looks like `FLOAT` is a supported keyword for creating tables but `REAL` is the correct keyword.\r\n\r\nSo actually `sqlite-utils` gets this wrong, because when we create a table we turn Python `float` values into a `FLOAT` column. Looks like the correct behaviour would be to turn them into a `REAL` column.\r\n\r\nhttps://github.com/simonw/sqlite-utils/blob/43f1c6ab4e3a6b76531fb6f5447adb83d26f3971/sqlite_utils/db.py#L28-L48", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 581339961, "label": ".columns_dict doesn't work for all possible column types"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/92#issuecomment-599125557", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/92", "id": 599125557, "node_id": "MDEyOklzc3VlQ29tbWVudDU5OTEyNTU1Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-03-14T19:35:29Z", "updated_at": "2020-03-14T19:35:29Z", "author_association": "OWNER", "body": "Fixing that would technically constitute a breaking change for library consumers, so it should be a major version release.\r\n\r\nI'm not inclined to release `3.0` just for this one issue, so I'm going to hold back on fixing that and address the smaller issue in this bug as a dot release instead for the moment.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 581339961, "label": ".columns_dict doesn't work for all possible column types"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/92#issuecomment-599126831", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/92", "id": 599126831, "node_id": "MDEyOklzc3VlQ29tbWVudDU5OTEyNjgzMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-03-14T19:45:28Z", "updated_at": "2020-03-14T19:45:28Z", "author_association": "OWNER", "body": "Turns out there are a TON of valid column definitions that aren't being considered yet - https://www.sqlite.org/datatype3.html#affinity_name_examples - stuff like `VARYING CHARACTER(255)` and `DECIMAL(10,5)`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 581339961, "label": ".columns_dict doesn't work for all possible column types"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/92#issuecomment-599127197", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/92", "id": 599127197, "node_id": "MDEyOklzc3VlQ29tbWVudDU5OTEyNzE5Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-03-14T19:48:06Z", "updated_at": "2020-03-14T19:48:06Z", "author_association": "OWNER", "body": "Actually it looks like I should implement the exact rules described in https://www.sqlite.org/datatype3.html#determination_of_column_affinity\r\n\r\n> The affinity of a column is determined by the declared type of the column, according to the following rules in the order shown:\r\n> \r\n> 1. If the declared type contains the string \"INT\" then it is assigned INTEGER affinity.\r\n> 2. If the declared type of the column contains any of the strings \"CHAR\", \"CLOB\", or \"TEXT\" then that column has TEXT affinity. Notice that the type VARCHAR contains the string \"CHAR\" and is thus assigned TEXT affinity.\r\n> 3. If the declared type for a column contains the string \"BLOB\" or if no type is specified then the column has affinity BLOB.\r\n> 4. If the declared type for a column contains any of the strings \"REAL\", \"FLOA\", or \"DOUB\" then the column has REAL affinity.\r\n> 5. Otherwise, the affinity is NUMERIC.\r\n> \r\n> Note that the order of the rules for determining column affinity is important. A column whose declared type is \"CHARINT\" will match both rules 1 and 2 but the first rule takes precedence and so the column affinity will be INTEGER.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 581339961, "label": ".columns_dict doesn't work for all possible column types"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/92#issuecomment-599127453", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/92", "id": 599127453, "node_id": "MDEyOklzc3VlQ29tbWVudDU5OTEyNzQ1Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-03-14T19:50:08Z", "updated_at": "2020-03-14T19:50:08Z", "author_association": "OWNER", "body": "> If the declared type for a column contains the string \"BLOB\" or if no type is specified then the column has affinity BLOB\r\n\r\nI currently treat those as `str` - it sounds like I should treat them as `bytes`:\r\n\r\nhttps://github.com/simonw/sqlite-utils/blob/43f1c6ab4e3a6b76531fb6f5447adb83d26f3971/sqlite_utils/db.py#L68-L69\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 581339961, "label": ".columns_dict doesn't work for all possible column types"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/92#issuecomment-599128891", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/92", "id": 599128891, "node_id": "MDEyOklzc3VlQ29tbWVudDU5OTEyODg5MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-03-14T20:03:45Z", "updated_at": "2020-03-14T20:03:45Z", "author_association": "OWNER", "body": "I'm going to keep treating them as `str`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 581339961, "label": ".columns_dict doesn't work for all possible column types"}, "performed_via_github_app": null}