{"html_url": "https://github.com/simonw/sqlite-utils/issues/343#issuecomment-1055992544", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/343", "id": 1055992544, "node_id": "IC_kwDOCGYnMM4-8Srg", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-02T00:06:10Z", "updated_at": "2022-03-02T00:06:10Z", "author_association": "OWNER", "body": "Updated documentation: https://sqlite-utils.datasette.io/en/latest/python-api.html#setting-an-id-based-on-the-hash-of-the-row-contents\r\n\r\nDocumentation for the renamed `utils.hash_record()` function: https://sqlite-utils.datasette.io/en/latest/reference.html#sqlite-utils-utils-hash-record", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1063388037, "label": "Provide function to generate hash_id from specified columns"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/343#issuecomment-1055991226", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/343", "id": 1055991226, "node_id": "IC_kwDOCGYnMM4-8SW6", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-02T00:03:47Z", "updated_at": "2022-03-02T00:03:47Z", "author_association": "OWNER", "body": "Oops, broke mypy:\r\n\r\n```\r\nsqlite_utils/db.py:2600: error: Incompatible default for argument \"hash_id_columns\" (default has type \"Default\", argument has type \"Optional[Iterable[str]]\")\r\nFound 1 error in 1 file (checked 49 source files)\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1063388037, "label": "Provide function to generate hash_id from specified columns"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/343#issuecomment-1055855845", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/343", "id": 1055855845, "node_id": "IC_kwDOCGYnMM4-7xTl", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-01T21:04:45Z", "updated_at": "2022-03-01T22:43:38Z", "author_association": "OWNER", "body": "I'm going to make that `_hash()` utility function a documented, non-underscore-prefixed function too - called `hash_record()`.", "reactions": "{\"total_count\": 1, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 1, \"eyes\": 0}", "issue": {"value": 1063388037, "label": "Provide function to generate hash_id from specified columns"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/343#issuecomment-1055854884", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/343", "id": 1055854884, "node_id": "IC_kwDOCGYnMM4-7xEk", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-01T21:03:45Z", "updated_at": "2022-03-01T21:03:45Z", "author_association": "OWNER", "body": "Just found myself needing this capability myself!\r\n\r\nRelevant code:\r\n\r\nhttps://github.com/simonw/sqlite-utils/blob/8f386a0d300d1b1c76132bb75972b755049fb742/sqlite_utils/db.py#L2297-L2307\r\n\r\nhttps://github.com/simonw/sqlite-utils/blob/8f386a0d300d1b1c76132bb75972b755049fb742/sqlite_utils/db.py#L2996-L3001\r\n\r\nSo various functions could grow a `hash_id_columns=(\"title\", \"date\")` argument which causes just those columns to be included in the hash.\r\n\r\nBonus: if you use `hash_id_columns=...` without setting `hash_id=\"id\"` it could assume that you want the column to be called `id`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1063388037, "label": "Provide function to generate hash_id from specified columns"}, "performed_via_github_app": null}