Sqlite-utils

Latest version: v3.36

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

Scan your dependencies

Page 8 of 19

3.4

- `sqlite-utils insert --csv` now accepts optional `--delimiter` and `--quotechar` options. See [Alternative delimiters and quote characters](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-insert-csv-tsv-delimiter). ([223](https://github.com/simonw/sqlite-utils/issues/223))

3.3

- The `table.m2m()` method now accepts an optional `alter=True` argument to specify that any missing columns should be added to the referenced table. See [Working with many-to-many relationships](https://sqlite-utils.datasette.io/en/stable/python-api.html#python-api-m2m). ([222](https://github.com/simonw/sqlite-utils/issues/222))

3.2.1

- Fixed a bug where `.add_missing_columns()` failed to take case insensitive column names into account. ([221](https://github.com/simonw/sqlite-utils/issues/221))

3.2

This release introduces a new mechanism for speeding up `count(*)` queries using cached table counts, stored in a `_counts` table and updated by triggers. This mechanism is described in [Cached table counts using triggers](https://sqlite-utils.datasette.io/en/stable/python-api.html#python-api-cached-table-counts), and can be enabled using Python API methods or the new `enable-counts` CLI command. ([212](https://github.com/simonw/sqlite-utils/issues/212))

- `table.enable_counts()` method for enabling these triggers on a specific table.
- `db.enable_counts()` method for enabling triggers on every table in the database. ([213](https://github.com/simonw/sqlite-utils/issues/213))
- New `sqlite-utils enable-counts my.db` command for enabling counts on all or specific tables, see [Enabling cached counts](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-enable-counts). ([214](https://github.com/simonw/sqlite-utils/issues/214))
- New `sqlite-utils triggers` command for listing the triggers defined for a database or specific tables, see [Listing triggers](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-triggers). ([218](https://github.com/simonw/sqlite-utils/issues/218))
- New `db.use_counts_table` property which, if `True`, causes `table.count` to read from the `_counts` table. ([215](https://github.com/simonw/sqlite-utils/issues/215))
- `table.has_counts_triggers` property revealing if a table has been configured with the new `_counts` database triggers.
- `db.reset_counts()` method and `sqlite-utils reset-counts` command for resetting the values in the `_counts` table. ([219](https://github.com/simonw/sqlite-utils/issues/219))
- The previously undocumented `db.escape()` method has been renamed to `db.quote()` and is now covered by the documentation: [Quoting strings for use in SQL](https://sqlite-utils.datasette.io/en/stable/python-api.html#python-api-quote). ([217](https://github.com/simonw/sqlite-utils/issues/217))
- New `table.triggers_dict` and `db.triggers_dict` introspection properties. ([211](https://github.com/simonw/sqlite-utils/issues/211), [#216](https://github.com/simonw/sqlite-utils/issues/216))
- `sqlite-utils insert` now shows a more useful error message for invalid JSON. ([206](https://github.com/simonw/sqlite-utils/issues/206))

3.1.1

- Fixed failing test caused by `optimize` sometimes creating larger database files. ([209](https://github.com/simonw/sqlite-utils/issues/209))
- Documentation now lives on <https://sqlite-utils.datasette.io/>
- README now includes `brew install sqlite-utils` installation method.

3.1

- New command: `sqlite-utils analyze-tables my.db` outputs useful information about the table columns in the database, such as the number of distinct values and how many rows are null. See [Analyzing tables](https://sqlite-utils.readthedocs.io/en/stable/cli.html#cli-analyze-tables) for documentation. ([207](https://github.com/simonw/sqlite-utils/issues/207))
- New `table.analyze_column(column)` Python method used by the `analyze-tables` command - see [Analyzing a column](https://sqlite-utils.readthedocs.io/en/stable/python-api.html#python-api-analyze-column).
- The `table.update()` method now correctly handles values that should be stored as JSON. Thanks, Andreas Madsack. ([204](https://github.com/simonw/sqlite-utils/pull/204))

Page 8 of 19

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.