rowid,repo,release,date,body_markdown,published_at,topics 140912432,https://github.com/simonw/sqlite-utils,https://github.com/simonw/sqlite-utils/releases/tag/3.14,2021-08-02,"This release introduces the new [sqlite-utils convert command](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-convert) ([#251](https://github.com/simonw/sqlite-utils/issues/251)) and corresponding [table.convert(...)](https://sqlite-utils.datasette.io/en/stable/python-api.html#python-api-convert) Python method ([#302](https://github.com/simonw/sqlite-utils/issues/302)). These tools can be used to apply a Python conversion function to one or more columns of a table, either updating the column in place or using transformed data from that column to populate one or more other columns. This command-line example uses the Python standard library [textwrap module](https://docs.python.org/3/library/textwrap.html) to wrap the content of the `content` column in the `articles` table to 100 characters: ``` $ sqlite-utils convert content.db articles content\ '""\n"".join(textwrap.wrap(value, 100))'\ --import=textwrap ``` The same operation in Python code looks like this: ```python import sqlite_utils, textwrap db = sqlite_utils.Database(""content.db"") db[""articles""].convert(""content"", lambda v: ""\n"".join(textwrap.wrap(v, 100))) ``` See the full documentation for the [sqlite-utils convert command](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-convert) and the [table.convert(...)](https://sqlite-utils.datasette.io/en/stable/python-api.html#python-api-convert) Python method for more details. Also in this release: - The new `table.count_where(...)` method, for counting rows in a table that match a specific SQL `WHERE` clause. ([#305](https://github.com/simonw/sqlite-utils/issues/305)) - New `--silent` option for the [sqlite-utils insert-files command](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-insert-files) to hide the terminal progress bar, consistent with the `--silent` option for `sqlite-utils convert`. ([#301](https://github.com/simonw/sqlite-utils/issues/301))",2021-08-02T21:34:43Z,"[""cli"", ""click"", ""datasette"", ""datasette-io"", ""datasette-tool"", ""python"", ""sqlite"", ""sqlite-database""]"