Sqlite-utils

Latest version: v3.36

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

Scan your dependencies

Page 4 of 19

3.22.1

- All commands now include example usage in their `--help` - see [CLI reference](https://sqlite-utils.datasette.io/en/stable/cli-reference.html#cli-reference). ([384](https://github.com/simonw/sqlite-utils/issues/384))
- Python library documentation has a new [Getting started](https://sqlite-utils.datasette.io/en/stable/python-api.html#python-api-getting-started) section. ([387](https://github.com/simonw/sqlite-utils/issues/387))
- Documentation now uses [Plausible analytics](https://plausible.io/). ([#389](https://github.com/simonw/sqlite-utils/issues/389))

3.22

- New [CLI reference](https://sqlite-utils.datasette.io/en/stable/cli-reference.html#cli-reference) documentation page, listing the output of `--help` for every one of the CLI commands. ([383](https://github.com/simonw/sqlite-utils/issues/383))
- `sqlite-utils rows` now has `--limit` and `--offset` options for paginating through data. ([381](https://github.com/simonw/sqlite-utils/issues/381))
- `sqlite-utils rows` now has `--where` and `-p` options for filtering the table using a `WHERE` query, see [Returning all rows in a table](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-rows). ([382](https://github.com/simonw/sqlite-utils/issues/382))

3.21

CLI and Python library improvements to help run [ANALYZE](https://www.sqlite.org/lang_analyze.html) 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](https://simonwillison.net/2022/Jan/11/sqlite-utils/).

- New `sqlite-utils create-database` command for creating new empty database files. ([348](https://github.com/simonw/sqlite-utils/issues/348))
- New Python methods for running `ANALYZE` against a database, table or index: `db.analyze()` and `table.analyze()`, see [Optimizing index usage with ANALYZE](https://sqlite-utils.datasette.io/en/stable/python-api.html#python-api-analyze). ([366](https://github.com/simonw/sqlite-utils/issues/366))
- New [sqlite-utils analyze command](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-analyze) for running `ANALYZE` using the CLI. ([379](https://github.com/simonw/sqlite-utils/issues/379))
- The `create-index`, `insert` and `upsert` commands now have a new `--analyze` option for running `ANALYZE` after the command has completed. ([379](https://github.com/simonw/sqlite-utils/issues/379))
- New [sqlite-utils bulk command](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-bulk) 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](https://github.com/simonw/sqlite-utils/issues/375))
- The CLI tool can now also be run using `python -m sqlite_utils`. ([368](https://github.com/simonw/sqlite-utils/issues/368))
- Using `--fmt` now implies `--table`, so you don't need to pass both options. ([374](https://github.com/simonw/sqlite-utils/issues/374))
- The `--convert` function applied to rows can now modify the row in place. ([371](https://github.com/simonw/sqlite-utils/issues/371))
- The [insert-files command](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-insert-files) supports two new columns: `stem` and `suffix`. ([372](https://github.com/simonw/sqlite-utils/issues/372))
- The `--nl` import option now ignores blank lines in the input. ([376](https://github.com/simonw/sqlite-utils/issues/376))
- Fixed bug where streaming input to the `insert` command with `--batch-size 1` would appear to only commit after several rows had been ingested, due to unnecessary input buffering. ([364](https://github.com/simonw/sqlite-utils/issues/364))

3.20

- `sqlite-utils insert ... --lines` to insert the lines from a file into a table with a single `line` column, see [Inserting unstructured data with --lines and --text](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-insert-unstructured).
- `sqlite-utils insert ... --text` to insert the contents of the file into a table with a single `text` column and a single row.
- `sqlite-utils insert ... --convert` allows 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](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-insert-convert), including details on special behavior when combined with `--lines` and `--text`. ([356](https://github.com/simonw/sqlite-utils/issues/356))
- `sqlite-utils convert` now accepts a code value of `-` to read code from standard input. ([353](https://github.com/simonw/sqlite-utils/issues/353))
- `sqlite-utils convert` also now accepts code that defines a named `convert(value)` function, see [Converting data in columns](https://sqlite-utils.datasette.io/en/stable/cli.html#cli-convert).
- `db.supports_strict` property showing if the database connection supports [SQLite strict tables](https://www.sqlite.org/stricttables.html).
- `table.strict` property (see [.strict](https://sqlite-utils.datasette.io/en/stable/python-api.html#python-api-introspection-strict)) indicating if the table uses strict mode. ([344](https://github.com/simonw/sqlite-utils/issues/344))
- Fixed bug where `sqlite-utils upsert ... --detect-types` ignored the `--detect-types` option. ([362](https://github.com/simonw/sqlite-utils/issues/362))

3.19

- The [table.lookup() method](https://sqlite-utils.datasette.io/en/stable/python-api.html#python-api-lookup-tables) now accepts keyword arguments that match those on the underlying `table.insert()` method: `foreign_keys=`, `column_order=`, `not_null=`, `defaults=`, `extracts=`, `conversions=` and `columns=`. You can also now pass `pk=` to specify a different column name to use for the primary key. ([342](https://github.com/simonw/sqlite-utils/issues/342))

3.19a0

- Extra keyword arguments for `table.lookup()` which are passed through to `.insert()`. [342](https://github.com/simonw/sqlite-utils/issues/342)

Page 4 of 19

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.