{"id": 1358321208, "node_id": "PR_kwDOCGYnMM5Q9lY4", "number": 553, "state": "closed", "locked": 0, "title": "Reformatted CLI examples in docs", "user": {"value": 9599, "label": "simonw"}, "body": "Refs:\r\n- #551\r\n\r\n\r\n----\n:books: Documentation preview :books:: https://sqlite-utils--553.org.readthedocs.build/en/553/\n\r\n", "created_at": "2023-05-21T20:44:34Z", "updated_at": "2023-05-21T20:57:27Z", "closed_at": "2023-05-21T20:57:23Z", "merged_at": "2023-05-21T20:57:22Z", "merge_commit_sha": "d8fe1b0d899faaaa3d4714a39328f4c24932278f", "assignee": null, "milestone": null, "draft": 0, "head": "21036a5084a2c846a05feb6bced3111d849bbe3c", "base": "e240133b11588d31dc22c632f7a7ca636c72978d", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/553", "merged_by": null, "auto_merge": null} {"id": 1406821147, "node_id": "PR_kwDOCGYnMM5T2mMb", "number": 560, "state": "closed", "locked": 0, "title": "Use sqlean if available in environment", "user": {"value": 9599, "label": "simonw"}, "body": "Refs:\r\n- #559 \r\n\r\n\r\n----\n:books: Documentation preview :books:: https://sqlite-utils--560.org.readthedocs.build/en/560/\n\r\n", "created_at": "2023-06-25T19:48:48Z", "updated_at": "2023-06-26T08:21:00Z", "closed_at": "2023-06-25T23:25:51Z", "merged_at": "2023-06-25T23:25:51Z", "merge_commit_sha": "f5c63088e1454811ce8361208b72297408eb5237", "assignee": null, "milestone": null, "draft": 0, "head": "5e7d27e5df024ce1f45e3a850c4e0f65e765cccd", "base": "2747257a3334d55e890b40ec58fada57ae8cfbfd", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/560", "merged_by": null, "auto_merge": null} {"id": 1445438054, "node_id": "PR_kwDOCGYnMM5WJ6Jm", "number": 573, "state": "closed", "locked": 0, "title": "feat: Implement a prepare_connection plugin hook", "user": {"value": 15178711, "label": "asg017"}, "body": "Just like the [Datasette prepare_connection hook](https://docs.datasette.io/en/stable/plugin_hooks.html#prepare-connection-conn-database-datasette), this PR adds a similar hook for the `sqlite-utils` plugin system. \r\n\r\nThe sole argument is `conn`, since I don't believe a `database` or `datasette` argument would be relevant here. \r\n\r\nI want to do this so I can release `sqlite-utils` plugins for my [SQLite extensions](https://github.com/asg017/sqlite-ecosystem), similar to the Datasette plugins I've release for them. \r\n\r\nAn example plugin: https://gist.github.com/asg017/d7cdf0d56e2be87efda28cebee27fa3c\r\n\r\n```bash\r\n$ sqlite-utils install https://gist.github.com/asg017/d7cdf0d56e2be87efda28cebee27fa3c/archive/5f5ad549a40860787629c69ca120a08c32519e99.zip\r\n\r\n$ sqlite-utils memory 'select hello(\"alex\") as response'\r\n[{\"response\": \"Hello, alex!\"}]\r\n```\r\nRefs:\r\n- #574 \r\n\r\n\r\n----\r\n:books: Documentation preview :books:: https://sqlite-utils--573.org.readthedocs.build/en/573/\r\n\r\n", "created_at": "2023-07-22T22:48:44Z", "updated_at": "2023-07-22T22:59:09Z", "closed_at": "2023-07-22T22:59:09Z", "merged_at": "2023-07-22T22:59:09Z", "merge_commit_sha": "3f80a026983d3e634f05a46f2a6da162b5139dd9", "assignee": null, "milestone": null, "draft": 0, "head": "faf398fe075f60929337d3cd0f12309fc4229a3c", "base": "091c63cfbf7b40e99e2017a3c37619c7689cc447", "author_association": "CONTRIBUTOR", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/573", "merged_by": null, "auto_merge": null} {"id": 1479795255, "node_id": "PR_kwDOCGYnMM5YM-I3", "number": 584, "state": "closed", "locked": 0, "title": ".transform() instead of modifying sqlite_master for add_foreign_keys", "user": {"value": 9599, "label": "simonw"}, "body": "Refs:\r\n- #577\r\n\r\n\r\n----\n:books: Documentation preview :books:: https://sqlite-utils--584.org.readthedocs.build/en/584/\n\r\n", "created_at": "2023-08-17T23:32:45Z", "updated_at": "2023-08-18T00:48:13Z", "closed_at": "2023-08-18T00:48:08Z", "merged_at": "2023-08-18T00:48:08Z", "merge_commit_sha": "509857ee8724f73760f3631b69c26f9047381187", "assignee": null, "milestone": null, "draft": 0, "head": "291505084e652972ad806383250757d41d596d38", "base": "1dc6b5aa644a92d3654f7068110ed7930989ce71", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/584", "merged_by": null, "auto_merge": null} {"id": 1507097949, "node_id": "PR_kwDOCGYnMM5Z1H1d", "number": 593, "state": "closed", "locked": 0, "title": ".transform() now preserves rowid values, refs #592", "user": {"value": 9599, "label": "simonw"}, "body": "Refs:\r\n- #592\r\n\r\n- [x] Tests against weird shaped tables\r\n\r\nI need to test that this works against:\r\n\r\n- `rowid` tables\r\n- Tables that have a column called `rowid` even though they are not rowid tables\r\n\r\n\r\n\r\n----\r\n:books: Documentation preview :books:: https://sqlite-utils--593.org.readthedocs.build/en/593/\r\n\r\n", "created_at": "2023-09-08T01:02:28Z", "updated_at": "2023-09-10T17:44:59Z", "closed_at": "2023-09-09T00:45:30Z", "merged_at": "2023-09-09T00:45:30Z", "merge_commit_sha": "1c6ea54338e24fcebcee4e2f9c170ee300a5d946", "assignee": null, "milestone": null, "draft": 0, "head": "b86374f705d1f4143a51634b30289cb48add0ea2", "base": "5d123f031fc4fadc98f508e0ef6b7b6671e86155", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/593", "merged_by": null, "auto_merge": null} {"id": 1586779743, "node_id": "PR_kwDOCGYnMM5elFZf", "number": 600, "state": "closed", "locked": 0, "title": "Add spatialite arm64 linux path", "user": {"value": 37802088, "label": "MikeCoats"}, "body": "According to both [Debian](https://packages.debian.org/bookworm/arm64/libsqlite3-mod-spatialite/filelist) and [Ubuntu](https://packages.ubuntu.com/mantic/arm64/libsqlite3-mod-spatialite/filelist), the correct \u201ctarget triple\u201d for arm64 is `aarch64-linux-gnu`, so we should be looking in `/usr/lib/aarch64-linux-gnu` for `mod_spatialite.so`.\r\n\r\nI can confirm that on both of my Debian arm64 SBCs, `libsqlite3-mod-spatialite` installs to that path.\r\n\r\n```\r\n$ ls -l /usr/lib/*/*spatial*\r\nlrwxrwxrwx 1 root root 23 Dec 1 2022 /usr/lib/aarch64-linux-gnu/mod_spatialite.so -> mod_spatialite.so.7.1.0\r\nlrwxrwxrwx 1 root root 23 Dec 1 2022 /usr/lib/aarch64-linux-gnu/mod_spatialite.so.7 -> mod_spatialite.so.7.1.0\r\n-rw-r--r-- 1 root root 7348584 Dec 1 2022 /usr/lib/aarch64-linux-gnu/mod_spatialite.so.7.1.0\r\n```\r\n\r\nThis is a set of before and after snippets of pytest\u2019s output for this PR.\r\n\r\n### Before\r\n\r\n```\r\n$ pytest\r\ntests/test_get.py ...... [ 73%]\r\ntests/test_gis.py ssssssssssss [ 75%]\r\ntests/test_hypothesis.py .... [ 75%]\r\n```\r\n\r\n### After\r\n\r\n```\r\n$ pytest\r\ntests/test_get.py ...... [ 73%]\r\ntests/test_gis.py ............ [ 75%]\r\ntests/test_hypothesis.py .... [ 75%]\r\n```\r\n\r\n\r\nIssue: #599\r\n\r\n\r\n----\n:books: Documentation preview :books:: https://sqlite-utils--600.org.readthedocs.build/en/600/\n\r\n", "created_at": "2023-11-03T22:23:26Z", "updated_at": "2023-11-04T00:34:33Z", "closed_at": "2023-11-04T00:31:49Z", "merged_at": "2023-11-04T00:31:49Z", "merge_commit_sha": "b92ea4793ce4dcb73cf762aae634ab72f65ec50f", "assignee": null, "milestone": null, "draft": 0, "head": "b1a60766a4150268557c4445297087a3f076be01", "base": "622c3a5a7dd53a09c029e2af40c2643fe7579340", "author_association": "CONTRIBUTOR", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/600", "merged_by": null, "auto_merge": null} {"id": 1542299634, "node_id": "PR_kwDOCGYnMM5b7Z_y", "number": 598, "state": "closed", "locked": 0, "title": "Fixed issue #433 - CLI eats cursor", "user": {"value": 62745, "label": "spookylukey"}, "body": "The issue is that underlying iterator is not fully consumed within the body of the `with file_progress()` block. Instead, that block creates generator expressions like `docs = (dict(zip(headers, row)) for row in reader)`\r\n\r\nThese iterables are consumed later, outside the `with file_progress()` block, which consumes the underlying iterator, and in turn updates the progress bar.\r\n\r\nThis means that the `ProgressBar.__exit__` method gets called before the last time the `ProgressBar.update` method gets called. The result is that the code to make the cursor invisible (inside the `update()` method) is called after the cleanup code to make it visible (in the `__exit__` method).\r\n\r\nThe fix is to move consumption of the `docs` iterators within the progress bar block. (\r\n\r\n(An additional fix, to make ProgressBar more robust against this kind of misuse, would to make it refusing to update after its `__exit__` method had been called, just like files cannot be `read()` after they are closed. That requires a in the click library).\r\n\r\nNote that Github diff obscures the simplicity of this diff, it's just indenting a block of code.\r\n\r\n\r\n\r\n----\n:books: Documentation preview :books:: https://sqlite-utils--598.org.readthedocs.build/en/598/\n\r\n", "created_at": "2023-10-04T18:06:58Z", "updated_at": "2023-11-04T00:46:55Z", "closed_at": "2023-11-04T00:40:30Z", "merged_at": "2023-11-04T00:40:30Z", "merge_commit_sha": "37273d7f63f08872aa1c90c4233a0580e384ac19", "assignee": null, "milestone": null, "draft": 0, "head": "76113d1cb1387811d556fb7a32e0628492c34aea", "base": "622c3a5a7dd53a09c029e2af40c2643fe7579340", "author_association": "CONTRIBUTOR", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/598", "merged_by": null, "auto_merge": null} {"id": 1535767490, "node_id": "PR_kwDOCGYnMM5bifPC", "number": 596, "state": "closed", "locked": 0, "title": "Fixes mapping for time fields related to mysql, closes #522", "user": {"value": 4420927, "label": "nezhar"}, "body": "Adds `COLUMN_TYPE_MAPPING` for `TIME` fields that are mapped as `datetime.timedelta` for MySQL and json represantation for `datetime.timedelta` in order to fix #522\r\n\r\n\r\n----\n:books: Documentation preview :books:: https://sqlite-utils--596.org.readthedocs.build/en/596/\n\r\n", "created_at": "2023-09-29T13:41:48Z", "updated_at": "2023-11-04T00:49:50Z", "closed_at": "2023-11-04T00:49:50Z", "merged_at": "2023-11-04T00:49:50Z", "merge_commit_sha": "347fdc865e91b8d3410f49a5c9d5b499fbb594c1", "assignee": null, "milestone": null, "draft": 0, "head": "ab12125b3f7d0ef327b08d95f27c6c4cec6fdfb3", "base": "622c3a5a7dd53a09c029e2af40c2643fe7579340", "author_association": "CONTRIBUTOR", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/596", "merged_by": null, "auto_merge": null} {"id": 1504920193, "node_id": "PR_kwDOCGYnMM5Zs0KB", "number": 591, "state": "closed", "locked": 0, "title": "Test against Python 3.12 preview", "user": {"value": 9599, "label": "simonw"}, "body": "https://dev.to/hugovk/help-test-python-312-beta-1508/\r\n\r\n\r\n----\n:books: Documentation preview :books:: https://sqlite-utils--591.org.readthedocs.build/en/591/\n\r\n", "created_at": "2023-09-06T16:10:00Z", "updated_at": "2023-11-04T00:58:03Z", "closed_at": "2023-11-04T00:58:02Z", "merged_at": null, "merge_commit_sha": "ac0db3c705355178bd5a337b8dd74df141b12c7a", "assignee": null, "milestone": null, "draft": 0, "head": "1f14df1de4a214b12abfba6edd61a4bfa0b8473e", "base": "347fdc865e91b8d3410f49a5c9d5b499fbb594c1", "author_association": "OWNER", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/591", "merged_by": null, "auto_merge": null} {"id": 1608050242, "node_id": "PR_kwDOCGYnMM5f2OZC", "number": 604, "state": "closed", "locked": 0, "title": "Add more STRICT table support", "user": {"value": 16437338, "label": "tkhattra"}, "body": "- https://github.com/simonw/sqlite-utils/issues/344#issuecomment-982014776\r\n\r\nMake `table.transform()` preserve STRICT mode.\r\n\r\n\r\n----\r\n:books: Documentation preview :books:: https://sqlite-utils--604.org.readthedocs.build/en/604/\r\n\r\n", "created_at": "2023-11-19T19:38:53Z", "updated_at": "2023-12-08T05:17:20Z", "closed_at": "2023-12-08T05:05:27Z", "merged_at": "2023-12-08T05:05:27Z", "merge_commit_sha": "1500c19bd0f31b2e7f28a5ec2d7bfa133a2e4d4c", "assignee": null, "milestone": null, "draft": 0, "head": "61c6e26cf922c70b65b161473723ff9d869a04a5", "base": "9286c1ba432e890b1bb4b2a1f847b15364c1fa18", "author_association": "CONTRIBUTOR", "repo": {"value": 140912432, "label": "sqlite-utils"}, "url": "https://github.com/simonw/sqlite-utils/pull/604", "merged_by": null, "auto_merge": null}