Sqlite-utils

Latest version: v3.36

Safety actively analyzes 638396 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 19

3.26.1

- Now depends on [click-default-group-wheel](https://github.com/simonw/click-default-group-wheel), a pure Python wheel package. This means you can install and use this package with [Pyodide](https://pyodide.org/), which can run Python entirely in your browser using WebAssembly. ([#429](https://github.com/simonw/sqlite-utils/pull/429))

Try that out using the [Pyodide REPL](https://pyodide.org/en/stable/console.html):

pycon
>>> import micropip
>>> await micropip.install("sqlite-utils")
>>> import sqlite_utils
>>> db = sqlite_utils.Database(memory=True)
>>> list(db.query("select 3 * 5"))
[{'3 * 5': 15}]

3.26

- New `errors=r.IGNORE/r.SET_NULL` parameter for the `r.parsedatetime()` and `r.parsedate()` [convert recipes](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-convert-recipes). ([416](https://github.com/simonw/sqlite-utils/issues/416))
- Fixed a bug where `--multi` could not be used in combination with `--dry-run` for the [convert](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-convert) command. ([415](https://github.com/simonw/sqlite-utils/issues/415))
- New documentation: [Using a convert() function to execute initialization](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-convert-complex). ([420](https://github.com/simonw/sqlite-utils/issues/420))
- More robust detection for whether or not `deterministic=True` is supported. ([425](https://github.com/simonw/sqlite-utils/issues/425))

3.25.1

- Improved display of type information and parameters in the [API reference documentation](https://sqlite-utils.datasette.io/en/stable/reference.html). [#413](https://github.com/simonw/sqlite-utils/issues/413)

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](https://sqlite-utils.datasette.io/en/stable/python-api.html#python-api-hash) for details. ([343](https://github.com/simonw/sqlite-utils/issues/343))
- New [db.sqlite_version](https://sqlite-utils.datasette.io/en/stable/python-api.html#python-api-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)](https://sqlite-utils.datasette.io/en/stable/python-api.html#python-api-register-function) caused errors on versions of SQLite prior to 3.8.3. ([408](https://github.com/simonw/sqlite-utils/issues/408))
- New documented [hash_record(record, keys=...)](https://sqlite-utils.datasette.io/en/stable/reference.html#reference-utils-hash-record) function.

3.24

- SpatiaLite helpers for the `sqlite-utils` command-line tool - thanks, Chris Amico. ([398](https://github.com/simonw/sqlite-utils/issues/398))
- [sqlite-utils create-database](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-create-database) `--init-spatialite` option for initializing SpatiaLite on a newly created database.
- [sqlite-utils add-geometry-column](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-spatialite) command for adding geometry columns.
- [sqlite-utils create-spatial-index](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-spatialite-indexes) command for adding spatial indexes.
- `db[table].create(..., if_not_exists=True)` option for [creating a table](https://sqlite-utils.datasette.io/en/stable/python-api.html#python-api-explicit-create) only if it does not already exist. ([397](https://github.com/simonw/sqlite-utils/issues/397))
- `Database(memory_name="my_shared_database")` parameter for creating a [named in-memory database](https://sqlite-utils.datasette.io/en/stable/python-api.html#python-api-connect) that can be shared between multiple connections. ([405](https://github.com/simonw/sqlite-utils/issues/405))
- Documentation now describes [how to add a primary key to a rowid table](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-transform-table-add-primary-key-to-rowid) using `sqlite-utils transform`. ([403](https://github.com/simonw/sqlite-utils/issues/403))

3.23

This release introduces four new utility methods for working with [SpatiaLite](https://www.gaia-gis.it/fossil/libspatialite/index). Thanks, Chris Amico. ([#330](https://github.com/simonw/sqlite-utils/pull/385))

- `sqlite_utils.utils.find_spatialite()` [finds the location of the SpatiaLite module](https://sqlite-utils.readthedocs.io/en/stable/python-api.html#python-api-gis-find-spatialite) on disk.
- `db.init_spatialite()` [initializes SpatiaLite](https://sqlite-utils.readthedocs.io/en/stable/python-api.html#python-api-gis-init-spatialite) for the given database.
- `table.add_geometry_column(...)` [adds a geometry column](https://sqlite-utils.readthedocs.io/en/stable/python-api.html#python-api-gis-add-geometry-column) to an existing table.
- `table.create_spatial_index(...)` [creates a spatial index](https://sqlite-utils.readthedocs.io/en/stable/python-api.html#python-api-gis-create-spatial-index) for a column.
- `sqlite-utils batch` now accepts a `--batch-size` option. ([392](https://github.com/simonw/sqlite-utils/issues/392))

Page 3 of 19

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.