sqlite-utils/sqlite_utils
seger aafb16fbe8 Ability to define unique columns when creating a table
Adds a new unique= argument to Database.create_table(), Table.create(),
Table.transform() and the table-creating insert/upsert methods
(insert, insert_all, upsert, upsert_all). A string names a single
column and a tuple names a compound constraint spanning several
columns, so unique=["email"] and unique=[("account_id", "email")]
are both supported. The argument is also available as a table
default via db.table(..., unique=[...]).

Also adds a table.uniques introspection property that lists the
UNIQUE constraints on a table, mirroring table.checks.

Refs #558
2026-10-07 16:19:50 +00:00
..
__init__.py Support ANY column types for strict tables 2026-08-12 16:44:01 -07:00
__main__.py Support 'python -m sqlite_utils', closes #368 2022-01-08 18:33:22 -08:00
cli.py Support ANY column types for strict tables 2026-08-12 16:44:01 -07:00
create_table_parser.py Preserve composite UNIQUE constraints in transforms 2026-08-12 18:46:18 -07:00
db.py Ability to define unique columns when creating a table 2026-10-07 16:19:50 +00:00
hookspecs.py Fixes for Ruff>=0.16.0 (#814) 2026-07-25 14:53:12 -07:00
migrations.py Fixes for Ruff>=0.16.0 (#814) 2026-07-25 14:53:12 -07:00
plugins.py Fixes for Ruff>=0.16.0 (#814) 2026-07-25 14:53:12 -07:00
py.typed py.typed file so mypy picks up the types, closes #331 2021-11-14 15:21:04 -08:00
recipes.py Fixes for Ruff>=0.16.0 (#814) 2026-07-25 14:53:12 -07:00
utils.py Fix resource leaks caused by buffered readers 2026-09-22 11:35:41 -07:00