3.34
This release introduces a new plugin system. (#567)
- Documentation describing how to build a plugin.
- Plugin hook: register_commands(cli), for plugins to add extra commands to
sqlite-utils
. (#569) - Plugin hook: prepare_connection(conn). Plugins can use this to help prepare the SQLite connection to do things like registering custom SQL functions. Thanks, Alex Garcia. (#574)
sqlite_utils.Database(..., execute_plugins=False)
option for disabling plugin execution. (#575)sqlite-utils install -e path-to-directory
option for installing editable code. This option is useful during the development of a plugin. (#570)table.create(...)
method now acceptsreplace=True
to drop and replace an existing table with the same name, orignore=True
to silently do nothing if a table already exists with the same name. (#568)sqlite-utils insert ... --stop-after 10
option for stopping the insert after a specified number of records. Works for theupsert
command as well. (#561)- The
--csv
and--tsv
modes forinsert
now accept a--empty-null
option, which cases empty strings in the CSV file to be stored asnull
in the database. (#563) - New
db.rename_table(table_name, new_name)
method for renaming tables. (#565) sqlite-utils rename-table my.db table_name new_name
command for renaming tables. (#565)- The
table.transform(...)
method now takes an optionalkeep_table=new_table_name
parameter, which will cause the original table to be renamed tonew_table_name
rather than being dropped at the end of the transformation. (#571) - Documentation now notes that calling
table.transform()
without any arguments will reformat the SQL schema stored by SQLite to be more aesthetically pleasing. (#564)