Sqlite-utils

Latest version: v3.36

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

Scan your dependencies

Page 15 of 19

2.2

New feature: `sqlite_utils.suggest_column_types([records])` returns the suggested column types for a list of records. See [Suggesting column types](https://sqlite-utils.readthedocs.io/en/stable/python-api.html#python-api-suggest-column-types). (81).

This replaces the undocumented `table.detect_column_types()` method.

2.1

New feature: `conversions={...}` can be passed to the `.insert()` family of functions to specify SQL conversions that should be applied to values that are being inserted or updated. See [Converting column values using SQL functions](https://sqlite-utils.readthedocs.io/en/stable/python-api.html#python-api-conversions). (77).

2.0.1

The `.upsert()` and `.upsert_all()` methods now raise a `sqlite_utils.db.PrimaryKeyRequired` exception if you call them without specifying the primary key column using `pk=` (73).

2.0

This release changes the behaviour of `upsert`. It’s a breaking change, hence 2.0.

The `upsert` command-line utility and the `.upsert()` and `.upsert_all()` Python API methods have had their behaviour altered. They used to completely replace the affected records: now, they update the specified values on existing records but leave other columns unaffected.

See [Upserting data using the Python API](https://sqlite-utils.readthedocs.io/en/stable/python-api.html#python-api-upsert) and [Upserting data using the CLI](https://sqlite-utils.readthedocs.io/en/stable/cli.html#upserting-data) for full details.

If you want the old behaviour - where records were completely replaced - you can use `$ sqlite-utils insert ... --replace` on the command-line and `.insert(..., replace=True)` and `.insert_all(..., replace=True)` in the Python API. See [Insert-replacing data using the Python API](https://sqlite-utils.readthedocs.io/en/stable/python-api.html#python-api-insert-replace) and [Insert-replacing data using the CLI](https://sqlite-utils.readthedocs.io/en/stable/cli.html#cli-insert-replace) for more.

For full background on this change, see issue 66.

1.12.1

https://sqlite-utils.readthedocs.io/en/latest/changelog.html#v1-12-1

1.12

https://sqlite-utils.readthedocs.io/en/latest/changelog.html#v1-12

Page 15 of 19

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.