TL;DR
sqlite-utils 4.1 introduces the ability to generate new rows directly from Python code blocks passed as CLI arguments. This feature builds on existing functionality and addresses a long-standing user request.
✦ Why It Matters
Engineers can implement the new row generation feature in sqlite-utils to enhance data manipulation workflows immediately.
Key Takeaways
Full Summary
The latest release of sqlite-utils, version 4.1, builds on the previous 4.0 version by adding several user-requested features. Notably, the 'insert' and 'upsert' commands now accept a '--code' option, allowing users to define a 'rows()' function directly in the command line, which can yield rows to be inserted.
Additionally, users can override automatically chosen column types with the '--type' option, which is particularly useful for preserving leading zeros in ZIP codes. A new method, 'table.drop_index(name)', allows for easy index removal, and the 'query' command can now read SQL queries from standard input.
Other improvements include inferring primary keys during upserts and the ability to toggle strict mode for tables, inspired by community feedback. These enhancements were implemented with the help of Codex, which also assisted in identifying and fixing minor bugs during testing.
Related