github simonw/sqlite-utils 4.0

3 hours ago

The 4.0 release includes some minor backwards-incompatible fixes (hence the major version number bump) and introduces three major new features:

Other notable changes include:

  • Upserts now use SQLite’s INSERT ... ON CONFLICT ... DO UPDATE SET syntax, detect existing table primary keys automatically and reject records that are missing required primary key values. (#652)
  • db.query() now executes immediately and rejects statements that do not return rows; use db.execute() for writes and DDL.
  • CSV and TSV imports now detect column types by default, while inserts into existing tables preserve those tables’ column types. (#679)
  • Foreign key handling now preserves ON DELETE/ON UPDATE actions during transforms and resolves referenced primary keys more accurately. (#530)
  • Column names passed to Python API methods are now matched case-insensitively, mirroring SQLite’s own identifier behavior. (#760)
  • The command-line tool now emits UTF-8 JSON output by default, with --ascii available to restore escaped output. (#625)
  • table.extract() and extracts= no longer create lookup table records for all-null values. (#186)

See Upgrading from 3.x to 4.0 for details on backwards-incompatible changes.

The detailed release notes for the features and fixes shipped during the 4.0 pre-release cycle are available in 4.0a0, 4.0a1, 4.0rc1, 4.0rc2, 4.0rc3 and 4.0rc4.

Don't miss a new sqlite-utils release

NewReleases is sending notifications on new releases.