Releases: simonw/sqlite-utils
Releases · simonw/sqlite-utils
3.26
- New
errors=r.IGNORE/r.SET_NULLparameter for ther.parsedatetime()andr.parsedate()convert recipes. (#416) - Fixed a bug where
--multicould not be used in combination with--dry-runfor the convert command. (#415) - New documentation: Using a convert() function to execute initialization. (#420)
- More robust detection for whether or not
deterministic=Trueis supported. (#425)
3.25.1
3.25
- New
hash_id_columns=parameter for creating a primary key that's a hash of the content of specific columns - see Setting an ID based on the hash of the row contents for details. (#343) - New db.sqlite_version property, returning a tuple of integers representing the version of SQLite, for example
(3, 38, 0). - Fixed a bug where register_function(deterministic=True) caused errors on versions of SQLite prior to 3.8.3. (#408)
- New documented hash_record(record, keys=...) function.
3.24
- SpatiaLite helpers for the
sqlite-utilscommand-line tool - thanks, Chris Amico. (#398)- sqlite-utils create-database
--init-spatialiteoption for initializing SpatiaLite on a newly created database. - sqlite-utils add-geometry-column command for adding geometry columns.
- sqlite-utils create-spatial-index command for adding spatial indexes.
- sqlite-utils create-database
db[table].create(..., if_not_exists=True)option for creating a table only if it does not already exist. (#397)Database(memory_name="my_shared_database")parameter for creating a named in-memory database that can be shared between multiple connections. (#405)- Documentation now describes how to add a primary key to a rowid table using
sqlite-utils transform. (#403)
3.23
This release introduces four new utility methods for working with SpatiaLite. Thanks, Chris Amico. (#330)
sqlite_utils.utils.find_spatialite()finds the location of the SpatiaLite module on disk.db.init_spatialite()initializes SpatiaLite for the given database.table.add_geometry_column(...)adds a geometry column to an existing table.table.create_spatial_index(...)creates a spatial index for a column.sqlite-utils batchnow accepts a--batch-sizeoption. (#392)
3.22.1
- All commands now include example usage in their
--help- see CLI reference. (#384) - Python library documentation has a new Getting started section. (#387)
- Documentation now uses Plausible analytics. (#389)
3.22
- New CLI reference documentation page, listing the output of
--helpfor every one of the CLI commands. (#383) sqlite-utils rowsnow has--limitand--offsetoptions for paginating through data. (#381)sqlite-utils rowsnow has--whereand-poptions for filtering the table using aWHEREquery, see Returning all rows in a table. (#382)
3.21
CLI and Python library improvements to help run ANALYZE after creating indexes or inserting rows, to gain better performance from the SQLite query planner when it runs against indexes.
Three new CLI commands: create-database, analyze and bulk.
More details and examples can be found in the annotated release notes.
- New
sqlite-utils create-databasecommand for creating new empty database files. (#348) - New Python methods for running
ANALYZEagainst a database, table or index:db.analyze()andtable.analyze(), see Optimizing index usage with ANALYZE. (#366) - New sqlite-utils analyze command for running
ANALYZEusing the CLI. (#379) - The
create-index,insertandupsertcommands now have a new--analyzeoption for runningANALYZEafter the command has completed. (#379) - New sqlite-utils bulk command which can import records in the same way as
sqlite-utils insert(from JSON, CSV or TSV) and use them to bulk execute a parametrized SQL query. (#375) - The CLI tool can now also be run using
python -m sqlite_utils. (#368) - Using
--fmtnow implies--table, so you don't need to pass both options. (#374) - The
--convertfunction applied to rows can now modify the row in place. (#371) - The insert-files command supports two new columns:
stemandsuffix. (#372) - The
--nlimport option now ignores blank lines in the input. (#376) - Fixed bug where streaming input to the
insertcommand with--batch-size 1would appear to only commit after several rows had been ingested, due to unnecessary input buffering. (#364)
3.20
sqlite-utils insert ... --linesto insert the lines from a file into a table with a singlelinecolumn, see Inserting unstructured data with --lines and --text.sqlite-utils insert ... --textto insert the contents of the file into a table with a singletextcolumn and a single row.sqlite-utils insert ... --convertallows a Python function to be provided that will be used to convert each row that is being inserted into the database. See Applying conversions while inserting data, including details on special behavior when combined with--linesand--text. (#356)sqlite-utils convertnow accepts a code value of-to read code from standard input. (#353)sqlite-utils convertalso now accepts code that defines a namedconvert(value)function, see Converting data in columns.db.supports_strictproperty showing if the database connection supports SQLite strict tables.table.strictproperty (see .strict) indicating if the table uses strict mode. (#344)- Fixed bug where
sqlite-utils upsert ... --detect-typesignored the--detect-typesoption. (#362)
3.19
- The table.lookup() method now accepts keyword arguments that match those on the underlying
table.insert()method:foreign_keys=,column_order=,not_null=,defaults=,extracts=,conversions=andcolumns=. You can also now passpk=to specify a different column name to use for the primary key. (#342)