{"html_url": "https://github.com/simonw/sqlite-utils/issues/366#issuecomment-1009508865", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/366", "id": 1009508865, "node_id": "IC_kwDOCGYnMM48K-IB", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-11T01:08:51Z", "updated_at": "2022-01-11T01:08:51Z", "author_association": "OWNER", "body": "The Python methods are all done now, next step is the CLI options. I'll do those in a separate issue.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1096563265, "label": "Python library methods for calling ANALYZE"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/365#issuecomment-1009521921", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/365", "id": 1009521921, "node_id": "IC_kwDOCGYnMM48LBUB", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-11T01:37:53Z", "updated_at": "2022-01-11T01:37:53Z", "author_association": "OWNER", "body": "I decided to go with making this opt-in, mainly for consistency with the other places where I added this feature - see:\r\n- #379 \r\n- #366\r\n\r\nYou can now run the following:\r\n\r\n sqlite-utils create-index mydb.db mytable mycolumn --analyze\r\n\r\nAnd ``ANALYZE`` will be run on the index once it has been created.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1096558279, "label": "create-index should run analyze after creating index"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/pull/377#issuecomment-1009531863", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/377", "id": 1009531863, "node_id": "IC_kwDOCGYnMM48LDvX", "user": {"value": 22429695, "label": "codecov[bot]"}, "created_at": "2022-01-11T02:03:00Z", "updated_at": "2022-01-11T02:03:00Z", "author_association": "NONE", "body": "# [Codecov](https://codecov.io/gh/simonw/sqlite-utils/pull/377?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) Report\n> Merging [#377](https://codecov.io/gh/simonw/sqlite-utils/pull/377?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) (f4ea0d3) into [main](https://codecov.io/gh/simonw/sqlite-utils/commit/b6dad08a8389736b7e960cfe9bc719cfc21a98f5?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) (b6dad08) will **decrease** coverage by `0.01%`.\n> The diff coverage is `96.00%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/simonw/sqlite-utils/pull/377/graphs/tree.svg?width=650&height=150&src=pr&token=O0X3703L9P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison)](https://codecov.io/gh/simonw/sqlite-utils/pull/377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison)\n\n```diff\n@@ Coverage Diff @@\n## main #377 +/- ##\n==========================================\n- Coverage 96.52% 96.50% -0.02% \n==========================================\n Files 6 6 \n Lines 2330 2378 +48 \n==========================================\n+ Hits 2249 2295 +46 \n- Misses 81 83 +2 \n```\n\n\n| [Impacted Files](https://codecov.io/gh/simonw/sqlite-utils/pull/377?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison) | Coverage \u0394 | |\n|---|---|---|\n| [sqlite\\_utils/cli.py](https://codecov.io/gh/simonw/sqlite-utils/pull/377/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison#diff-c3FsaXRlX3V0aWxzL2NsaS5weQ==) | `95.49% <94.28%> (-0.06%)` | :arrow_down: |\n| [sqlite\\_utils/db.py](https://codecov.io/gh/simonw/sqlite-utils/pull/377/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison#diff-c3FsaXRlX3V0aWxzL2RiLnB5) | `97.68% <100.00%> (+0.03%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/simonw/sqlite-utils/pull/377?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison)\n> `\u0394 = absolute (impact)`, `\u00f8 = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/simonw/sqlite-utils/pull/377?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison). Last update [b6dad08...f4ea0d3](https://codecov.io/gh/simonw/sqlite-utils/pull/377?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Simon+Willison).\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1097477582, "label": "`sqlite-utils bulk` command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/pull/377#issuecomment-1009532125", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/377", "id": 1009532125, "node_id": "IC_kwDOCGYnMM48LDzd", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-11T02:03:35Z", "updated_at": "2022-01-11T02:03:35Z", "author_association": "OWNER", "body": "Documentation: https://github.com/simonw/sqlite-utils/blob/f4ea0d32c0543373eefaa9b9f3911eb07549eecb/docs/cli.rst#executing-sql-in-bulk", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1097477582, "label": "`sqlite-utils bulk` command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/pull/377#issuecomment-1009534817", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/377", "id": 1009534817, "node_id": "IC_kwDOCGYnMM48LEdh", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-11T02:09:38Z", "updated_at": "2022-01-11T02:09:38Z", "author_association": "OWNER", "body": "I tested this like so:\r\n```\r\n% wget 'https://raw.githubusercontent.com/wri/global-power-plant-database/master/output_database/global_power_plant_database.csv'\r\n% sqlite-utils create-database test.db\r\n% sqlite-utils create-table test.db power_plants url text owner text\r\n% sqlite-utils schema test.db \r\nCREATE TABLE [power_plants] (\r\n [url] TEXT,\r\n [owner] TEXT\r\n);\r\n% sqlite-utils bulk test.db 'insert into power_plants (url, owner) values (:url, :owner)' global_power_plant_database.csv --csv\r\n [------------------------------------] 0%\r\n [###################################-] 99%\r\n% sqlite-utils tables --counts test.db -t\r\ntable count\r\n------------ -------\r\npower_plants 33643\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1097477582, "label": "`sqlite-utils bulk` command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/375#issuecomment-1009536276", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/375", "id": 1009536276, "node_id": "IC_kwDOCGYnMM48LE0U", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-11T02:12:58Z", "updated_at": "2022-01-11T02:12:58Z", "author_association": "OWNER", "body": "Documentation: https://sqlite-utils.datasette.io/en/latest/cli.html#executing-sql-in-bulk", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1097251014, "label": "`sqlite-utils bulk` command"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/380#issuecomment-1009544785", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/380", "id": 1009544785, "node_id": "IC_kwDOCGYnMM48LG5R", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-11T02:32:56Z", "updated_at": "2022-01-11T02:32:56Z", "author_association": "OWNER", "body": "CLI and Python library improvements to help run [ANALYZE](https://www.sqlite.org/lang_analyze.html) after creating indexes or inserting rows, to gain better performance from the SQLite query planner when it runs against indexes.\r\n\r\nThree new CLI commands: `create-database`, `analyze` and `bulk`.\r\n\r\n- New `sqlite-utils create-database` command for creating new empty database files. ([#348](https://github.com/simonw/sqlite-utils/issues/348))\r\n- New Python methods for running `ANALYZE` against a database, table or index: `db.analyze()` and `table.analyze()`, see [Optimizing index usage with ANALYZE](https://sqlite-utils.datasette.io/en/stable/python-api.html#python-api-analyze). ([#366](https://github.com/simonw/sqlite-utils/issues/366))\r\n- New [sqlite-utils analyze command](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-analyze) for running `ANALYZE` using the CLI. ([#379](https://github.com/simonw/sqlite-utils/issues/379))\r\n- The `create-index`, `insert` and `update` commands now have a new `--analyze` option for running `ANALYZE` after the command has completed. ([#379](https://github.com/simonw/sqlite-utils/issues/379))\r\n- New [sqlite-utils bulk command](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-bulk) which can import records in the same way as `sqlite-utils insert` (from JSON, CSV or TSV) and use them to bulk execute a parametrized SQL query. ([#375](https://github.com/simonw/sqlite-utils/issues/375))\r\n- The CLI tool can now also be run using `python -m sqlite_utils`. ([#368](https://github.com/simonw/sqlite-utils/issues/368))\r\n- Using `--fmt` now implies `--table`, so you don't need to pass both options. ([#374](https://github.com/simonw/sqlite-utils/issues/374))\r\n- The `--convert` function applied to rows can now modify the row in place. ([#371](https://github.com/simonw/sqlite-utils/issues/371))\r\n- The [insert-files command](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-insert-files) supports two new columns: `stem` and `suffix`. ([#372](https://github.com/simonw/sqlite-utils/issues/372))\r\n- The `--nl` import option now ignores blank lines in the input. ([#376](https://github.com/simonw/sqlite-utils/issues/376))\r\n- Fixed bug where streaming input to the `insert` command with `--batch-size 1` would appear to only commit after several rows had been ingested, due to unnecessary input buffering. ([#364](https://github.com/simonw/sqlite-utils/issues/364))", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1098574572, "label": "Release notes for 3.21"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/365#issuecomment-1009548580", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/365", "id": 1009548580, "node_id": "IC_kwDOCGYnMM48LH0k", "user": {"value": 536941, "label": "fgregg"}, "created_at": "2022-01-11T02:43:34Z", "updated_at": "2022-01-11T02:43:34Z", "author_association": "CONTRIBUTOR", "body": "thanks so much! always a pleasure to see how you work through these things", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1096558279, "label": "create-index should run analyze after creating index"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/383#issuecomment-1010333511", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/383", "id": 1010333511, "node_id": "IC_kwDOCGYnMM48OHdH", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-11T20:27:08Z", "updated_at": "2022-01-11T20:27:08Z", "author_association": "OWNER", "body": "I'll call the new page \"CLI reference\", for consistency with the API reference page here: https://sqlite-utils.datasette.io/en/stable/reference.html", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1099586786, "label": "Add documentation page with the output of `--help`"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/383#issuecomment-1010386802", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/383", "id": 1010386802, "node_id": "IC_kwDOCGYnMM48OUdy", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-11T21:44:53Z", "updated_at": "2022-01-11T21:44:53Z", "author_association": "OWNER", "body": "Here's the `cog` code I used: https://github.com/simonw/sqlite-utils/blob/1d44b0cc2784c94aed1bcf350225cd86ee1aa7e5/docs/cli-reference.rst#L11-L76", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1099586786, "label": "Add documentation page with the output of `--help`"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/383#issuecomment-1010387223", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/383", "id": 1010387223, "node_id": "IC_kwDOCGYnMM48OUkX", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-11T21:45:32Z", "updated_at": "2022-01-11T21:45:32Z", "author_association": "OWNER", "body": "The new page of documentation: https://sqlite-utils.datasette.io/en/latest/cli-reference.html", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1099586786, "label": "Add documentation page with the output of `--help`"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/383#issuecomment-1010440166", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/383", "id": 1010440166, "node_id": "IC_kwDOCGYnMM48Ohfm", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-11T22:55:05Z", "updated_at": "2022-01-11T22:55:05Z", "author_association": "OWNER", "body": "Twitter thread about this: https://twitter.com/simonw/status/1481020195074293761", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1099586786, "label": "Add documentation page with the output of `--help`"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/381#issuecomment-1010441118", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/381", "id": 1010441118, "node_id": "IC_kwDOCGYnMM48Ohue", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-11T22:56:53Z", "updated_at": "2022-01-11T22:57:09Z", "author_association": "OWNER", "body": "`sqlite-utils search` has `--limit` already: https://sqlite-utils.datasette.io/en/latest/cli-reference.html#search\r\n\r\n```\r\n --limit INTEGER Number of rows to return - defaults to everything\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1099584685, "label": "`sqlite-utils rows` options `--limit` and `--offset`"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/382#issuecomment-1010461844", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/382", "id": 1010461844, "node_id": "IC_kwDOCGYnMM48OmyU", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-11T23:33:14Z", "updated_at": "2022-01-11T23:33:14Z", "author_association": "OWNER", "body": "Documentation: https://sqlite-utils.datasette.io/en/latest/cli.html#returning-all-rows-in-a-table", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1099585611, "label": "`--where` option for `sqlite-rows`"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/381#issuecomment-1010462035", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/381", "id": 1010462035, "node_id": "IC_kwDOCGYnMM48Om1T", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-01-11T23:33:37Z", "updated_at": "2022-01-11T23:33:37Z", "author_association": "OWNER", "body": "Documentation: https://sqlite-utils.datasette.io/en/latest/cli.html#returning-all-rows-in-a-table", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1099584685, "label": "`sqlite-utils rows` options `--limit` and `--offset`"}, "performed_via_github_app": null}