{"html_url": "https://github.com/simonw/sqlite-utils/pull/468#issuecomment-1229303691", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/468", "id": 1229303691, "node_id": "IC_kwDOCGYnMM5JRa-L", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-08-27T23:13:06Z", "updated_at": "2022-08-27T23:13:06Z", "author_association": "OWNER", "body": "Documentation:\r\n- https://sqlite-utils--468.org.readthedocs.build/en/468/python-api.html#explicitly-creating-a-table\r\n- https://sqlite-utils--468.org.readthedocs.build/en/468/cli.html#creating-tables", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1348294436, "label": "db[table].create(..., transform=True) and create-table --transform"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/pull/468#issuecomment-1229284539", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/468", "id": 1229284539, "node_id": "IC_kwDOCGYnMM5JRWS7", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-08-27T22:54:07Z", "updated_at": "2022-08-27T22:55:01Z", "author_association": "OWNER", "body": "Just needs documentation now, which can go here: https://sqlite-utils--468.org.readthedocs.build/en/468/python-api.html#explicitly-creating-a-table", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1348294436, "label": "db[table].create(..., transform=True) and create-table --transform"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/pull/468#issuecomment-1229279539", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/468", "id": 1229279539, "node_id": "IC_kwDOCGYnMM5JRVEz", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-08-27T22:24:33Z", "updated_at": "2022-08-27T22:24:33Z", "author_association": "OWNER", "body": "Interesting challenge with `default_value`: I need to be able to tell if the default values passed to `.create()` differ from those in the database already.\r\n\r\nIntrospecting that is a bit tricky:\r\n\r\n```pycon\r\n>>> import sqlite_utils\r\n>>> db = sqlite_utils.Database(memory=True)\r\n>>> db[\"blah\"].create({\"id\": int, \"name\": str}, not_null=(\"name\",), defaults={\"name\": \"bob\"})\r\n\r\n>>> db[\"blah\"].columns\r\n[Column(cid=0, name='id', type='INTEGER', notnull=0, default_value=None, is_pk=0), Column(cid=1, name='name', type='TEXT', notnull=1, default_value=\"'bob'\", is_pk=0)]\r\n```\r\nNote how a default value of the Python string `bob` is represented in the results of `PRAGMA table_info()` as `default_value=\"'bob'\"` - it's got single quotes added to it!\r\n\r\nSo comparing default values from introspecting the database needs me to first parse that syntax. This may require a new table introspection method.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1348294436, "label": "db[table].create(..., transform=True) and create-table --transform"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/pull/468#issuecomment-1229276554", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/468", "id": 1229276554, "node_id": "IC_kwDOCGYnMM5JRUWK", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-08-27T22:05:40Z", "updated_at": "2022-08-27T22:05:51Z", "author_association": "OWNER", "body": "For the moment I'm not going to pay attention to `foreign_keys` changes - I will note that these are not modified in the documentation.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1348294436, "label": "db[table].create(..., transform=True) and create-table --transform"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/pull/468#issuecomment-1229207725", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/468", "id": 1229207725, "node_id": "IC_kwDOCGYnMM5JRDit", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-08-27T14:55:32Z", "updated_at": "2022-08-27T22:03:50Z", "author_association": "OWNER", "body": "The main challenge here is coming up with comprehensive tests. The cases I need to cover are from this block of code:\r\n\r\nhttps://github.com/simonw/sqlite-utils/blob/c5f8a2eb1a81a18b52825cc649112f71fe419b12/sqlite_utils/db.py#L1468-L1480", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1348294436, "label": "db[table].create(..., transform=True) and create-table --transform"}, "performed_via_github_app": null}