{"html_url": "https://github.com/simonw/datasette/issues/1012#issuecomment-753531657", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1012", "id": 753531657, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzUzMTY1Nw==", "user": {"value": 45380, "label": "bollwyvl"}, "created_at": "2021-01-02T21:25:36Z", "updated_at": "2021-01-02T21:25:36Z", "author_association": "CONTRIBUTOR", "body": "Actually, on more research, I found out this is handled by the [trove-classifiers package](https://github.com/pypa/trove-classifiers/blob/master/src/trove_classifiers/__init__.py#L2) now, so it's just a one-liner pr instead of fire-up-a-docker-container-and-do-some-migrations", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 718540751, "label": "For 1.0 update trove classifier in setup.py"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1168#issuecomment-753524779", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1168", "id": 753524779, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzUyNDc3OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-02T20:19:26Z", "updated_at": "2021-01-02T20:19:26Z", "author_association": "OWNER", "body": "Idea: version the metadata scheme. If the table is called `_metadata_v1` it gives me a clear path to designing a new scheme in the future.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 777333388, "label": "Mechanism for storing metadata in _metadata tables"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/210#issuecomment-753406744", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/210", "id": 753406744, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzQwNjc0NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-02T00:02:39Z", "updated_at": "2021-01-02T00:02:39Z", "author_association": "OWNER", "body": "It looks like https://github.com/ofajardo/pyreadr is a good library for this.\r\n\r\nI won't add this to `sqlite-utils` because it's quite a bulky dependency for a relatively small feature.\r\n\r\nNormally I'd write a `rdata-to-sqlite` tool similar to https://pypi.org/project/dbf-to-sqlite/ - but I'm actually working on a new plugin hook for Datasette that might be an even better fit for this. The idea is to allow Datasette plugins to define input formats - such as RData - which would then result in being able to import them on the command-line with `datasette insert my.db file.rdata` or by uploading a file through the Datasette web interface.\r\n\r\nThat work is happening over here: https://github.com/simonw/datasette/issues/1160 - I'll close this issue in favour of a sometime-in-the-future `datasette-import-rdata` plugin.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 767685961, "label": "Support of RData files"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/212#issuecomment-753422324", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/212", "id": 753422324, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzQyMjMyNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-02T03:00:34Z", "updated_at": "2021-01-02T03:00:34Z", "author_association": "OWNER", "body": "Here's a prototype:\r\n```python\r\nwith db.conn:\r\n db.conn.executescript(\"\"\"\r\nCREATE TABLE IF NOT EXISTS [_counts] ([table] TEXT PRIMARY KEY, [count] INTEGER DEFAULT 0);\r\nCREATE TRIGGER IF NOT EXISTS [Street_Tree_List_counts_ai] AFTER INSERT ON [Street_Tree_List] BEGIN\r\n INSERT OR REPLACE INTO _counts\r\n VALUES ('Street_Tree_List', COALESCE(\r\n (SELECT count FROM _counts\r\n WHERE [table]='Street_Tree_List'),\r\n 0) + 1);\r\nEND;\r\nCREATE TRIGGER IF NOT EXISTS [Street_Tree_List_counts_ad] AFTER DELETE ON [Street_Tree_List] BEGIN\r\n INSERT OR REPLACE INTO _counts\r\n VALUES ('Street_Tree_List', COALESCE(\r\n (SELECT count FROM _counts\r\n WHERE [table]='Street_Tree_List'),\r\n 0) - 1);\r\nEND;\r\nINSERT OR REPLACE INTO _counts VALUES ('Street_Tree_List', (select count(*) from [Street_Tree_List]));\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": 777392020, "label": "Mechanism for maintaining cache of table counts using triggers"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/213#issuecomment-753533775", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/213", "id": 753533775, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzUzMzc3NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-02T21:47:10Z", "updated_at": "2021-01-02T21:47:10Z", "author_association": "OWNER", "body": "I'm going to skip virtual tables, which I can identify using this property: https://github.com/simonw/sqlite-utils/blob/1cad7fad3e7a5b734088f5cc545b69a055e636da/sqlite_utils/db.py#L720-L726", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 777529979, "label": "db.enable_counts() method"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/213#issuecomment-753535488", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/213", "id": 753535488, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzUzNTQ4OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-02T22:03:48Z", "updated_at": "2021-01-02T22:03:48Z", "author_association": "OWNER", "body": "I got this error while prototyping this:\r\n\r\n too many levels of trigger recursion\r\n\r\nIt looks like that's because SQLite doesn't like triggers on a table that themselves then update that table - so I'm going to exclude the `_counts` table from this mechanism.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 777529979, "label": "db.enable_counts() method"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/215#issuecomment-753545381", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/215", "id": 753545381, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzU0NTM4MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-02T23:52:52Z", "updated_at": "2021-01-02T23:52:52Z", "author_association": "OWNER", "body": "Idea: a `db.cached_counts()` method that returns a dictionary of data from the `_counts` table. Call it with a list of tables to get back the counts for just those tables.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 777535402, "label": "Use _counts to speed up counts"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/215#issuecomment-753545757", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/215", "id": 753545757, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzU0NTc1Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-02T23:58:07Z", "updated_at": "2021-01-02T23:58:07Z", "author_association": "OWNER", "body": "Thought: maybe there should be a `.reset_counts()` method too, for if the table gets out of date with the triggers.\r\n\r\nOne way that could happen is if a table is dropped and recreated - the counts in the `_counts` table would likely no longer match the number of rows in that table.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 777535402, "label": "Use _counts to speed up counts"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/217#issuecomment-753544914", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/217", "id": 753544914, "node_id": "MDEyOklzc3VlQ29tbWVudDc1MzU0NDkxNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-02T23:47:42Z", "updated_at": "2021-01-02T23:47:42Z", "author_association": "OWNER", "body": "https://github.com/simonw/sqlite-utils/blob/9a5c92b63e7917c93cc502478493c51c781b2ecc/sqlite_utils/db.py#L231-L239", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 777543336, "label": "Rename .escape() to .quote()"}, "performed_via_github_app": null}