Skip to content

Releases: simonw/sqlite-utils

4.0rc1

21 Jun 23:30

Choose a tag to compare

4.0rc1 Pre-release
Pre-release
  • New database migrations system, incorporating functionality that was previously provided by the separate sqlite-migrate plugin. Define migration sets using the new sqlite_utils.Migrationsclass and apply them using the sqlite-utils migrate command or the migrations Python API. (#752)
  • New db.atomic() context manager providing nested transaction support using SQLite transactions and savepoints. Internal multi-step operations such as table.transform() now use this mechanism to avoid unexpectedly committing an existing transaction. (#755)
  • Database objects can now be used as context managers, automatically closing the connection when the with block exits. The CLI also now closes database and file handles more reliably, resolving a number of ResourceWarning warnings. (#692)
  • The sqlite-utils convert command can now accept a direct callable reference such as r.parsedate or json.loads --import json as the conversion code, as an alternative to calling it explicitly with r.parsedate(value). (#686)
  • Fixed a bug where CSV or TSV files with only a header row could crash sqlite-utils insert and sqlite-utils memory when type detection was enabled. Thanks, Rami Abdelrazzaq. (#702, #707)
  • Fixed a bug where installed plugins could be loaded while running the test suite, despite the test-mode safeguard that disables plugin loading. Thanks, Rami Abdelrazzaq. (#713, #719)
  • table.detect_fts() now recognizes legacy FTS virtual tables that quote the content= table name using square brackets, allowing table.enable_fts(..., replace=True) to replace them correctly. (#694)
  • Now depends on Click 8.3.1 or later, removing compatibility workarounds for Click's Sentineldefault values. (#666)
  • Improved type annotations throughout the package, with ty now run in CI. (#697)
  • Development tooling now uses uv dependency groups, with separate dev and docs groups. (#691)
  • The test suite now runs against Python 3.15-dev. (#738)

4.0a1

24 Nov 06:32

Choose a tag to compare

4.0a1 Pre-release
Pre-release
  • Breaking change: The db.table(table_name) method now only works with tables. To access a SQL view use db.view(view_name) instead. (#657)
  • The table.insert_all() and table.upsert_all() methods can now accept an iterator of lists or tuples as an alternative to dictionaries. The first item should be a list/tuple of column names. See Inserting data from a list or tuple iterator for details. (#672)
  • Breaking change: The default floating point column type has been changed from FLOAT to REAL, which is the correct SQLite type for floating point values. This affects auto-detected columns when inserting data. (#645)
  • Now uses pyproject.toml in place of setup.py for packaging. (#675)
  • Tables in the Python API now do a much better job of remembering the primary key and other schema details from when they were first created. (#655)
  • Breaking change: The table.convert() and sqlite-utils convert mechanisms no longer skip values that evaluate to False. Previously the --skip-false option was needed, this has been removed. (#542)
  • Breaking change: Tables created by this library now wrap table and column names in "double-quotes" in the schema. Previously they would use [square-braces]. (#677)
  • The --functions CLI argument now accepts a path to a Python file in addition to accepting a string full of Python code. It can also now be specified multiple times. (#659)
  • Breaking change: Type detection is now the default behavior for the insert and upsert CLI commands when importing CSV or TSV data. Previously all columns were treated as TEXT unless the --detect-types flag was passed. Use the new --no-detect-types flag to restore the old behavior. The SQLITE_UTILS_DETECT_TYPES environment variable has been removed. (#679)

3.39

24 Nov 18:42

Choose a tag to compare

  • Fixed a bug with sqlite-utils install when the tool had been installed using uv. (#687)
  • The --functions argument now optionally accepts a path to a Python file as an alternative to a string full of code, and can be specified multiple times – see Defining custom SQL functions. (#659)
  • sqlite-utils now requires Python 3.10 or higher.

sqlite-utils 4.0a1 is now available as an alpha with some minor breaking changes.

4.0a0

09 May 03:54

Choose a tag to compare

4.0a0 Pre-release
Pre-release
  • Upsert operations now use SQLite's INSERT ... ON CONFLICT SET syntax on all SQLite versions later than 3.23.1. This is a very slight breaking change for apps that depend on the previous INSERT OR IGNORE followed by UPDATE behavior. (#652)
  • Python library users can opt-in to the previous implementation by passing use_old_upsert=True to the Database() constructor, see Alternative upserts using INSERT OR IGNORE.
  • Dropped support for Python 3.8, added support for Python 3.13. (#646)
  • sqlite-utils tui is now provided by the sqlite-utils-tui plugin. (#648)
  • Test suite now also runs against SQLite 3.23.1, the last version (from 2018-04-10) before the new INSERT ... ON CONFLICT SET syntax was added. (#654)

3.38

23 Nov 22:40

Choose a tag to compare

  • Plugins can now reuse the implementation of the sqlite-utils memory CLI command with the new return_db=True parameter. (#643)
  • table.transform() now recreates indexes after transforming a table. A new sqlite_utils.db.TransformError exception is raised if these indexes cannot be recreated due to conflicting changes to the table such as a column rename. Thanks, Mat Miller. (#633)
  • table.search() now accepts a include_rank=True parameter, causing the resulting rows to have a rank column showing the calculated relevance score. Thanks, liunux4odoo. (#628)
  • Fixed an error that occurred when creating a strict table with at least one floating point column. These FLOAT columns are now correctly created as REAL as well, but only for strict tables. (#644)

3.38a0

08 Nov 20:14

Choose a tag to compare

3.38a0 Pre-release
Pre-release
  • Plugins can now reuse the sqlite-utils memory command with the new return_db=True parameter. #643

3.37

18 Jul 18:44

Choose a tag to compare

  • The create-table and insert-files commands all now accept multiple --pk options for compound primary keys. (#620)
  • Now tested against Python 3.13 pre-release. (#619)
  • Fixed a crash that can occur in environments with a broken numpy installation, producing a module 'numpy' has no attribute 'int8'. (#632)

3.36

08 Dec 05:32

Choose a tag to compare

  • Support for creating tables in SQLite STRICT mode. Thanks, Taj Khattra. (#344)
    • CLI commands create-table, insert and upsert all now accept a --strict option.
    • Python methods that can create a table - table.create() and insert/upsert/insert_all/upsert_all all now accept an optional strict=True parameter.
    • The transform command and table.transform() method preserve strict mode when transforming a table.
  • The sqlite-utils create-table command now accepts str, int and bytes as aliases for text, integer and blob respectively. (#606)

3.35.2

04 Nov 01:05

Choose a tag to compare

  • The --load-extension=spatialite option and find_spatialite() utility function now both work correctly on arm64 Linux. Thanks, Mike Coats. (#599)
  • Fix for bug where sqlite-utils insert could cause your terminal cursor to disappear. Thanks, Luke Plant. (#433)
  • datetime.timedelta values are now stored as TEXT columns. Thanks, Harald Nezbeda. (#522)
  • Test suite is now also run against Python 3.12.

3.35.1

09 Sep 00:50

Choose a tag to compare

  • Fixed a bug where table.transform() would sometimes re-assign the rowid values for a table rather than keeping them consistent across the operation. (#592)