sqlite-utils/docs
dchaudhari7177 7b840e0f45 Docs: correct what transform() does to indexes, views and triggers
The line under "Custom transformations with .transform_sql()" said
`.transform()` "does not automatically upgrade indexes, views or triggers".
All three parts are wrong, and the trigger one is wrong in the dangerous
direction. Measured on current main:

    rename a column   triggers ['trg'] -> []  views kept  indexes kept
    change a type     triggers ['trg'] -> []  views kept  indexes kept
    drop a column     triggers ['trg'] -> []  views kept  indexes kept

* Indexes *are* handled. `transform_sql()` captures each one before the old
  table is dropped and reissues its CREATE INDEX, rewriting a renamed
  column: `CREATE INDEX "idx" ON "t" ("new_name")`.
* Views are kept, and were already documented accurately under "Tables
  referenced by views" -- so the old sentence also contradicted a section
  four paragraphs above it.
* Triggers are not merely "not upgraded". They are **dropped**. SQLite
  deletes a table's triggers with the table, and `transform_sql()` never
  captures them. A reader told the trigger was not *upgraded* would expect
  it to still exist, possibly stale. It is gone.

Replaces the sentence with an "Indexes and triggers" section covering what
actually happens, including the `UNIQUE`-constraint index case (not
reissued, because the constraint is reproduced in the new CREATE TABLE) and
the TransformError raised for any other index without stored SQL.

The trigger part carries a recipe using `table.triggers_dict`, with the
caveat that a captured trigger body still names the old columns. Both the
recipe and every claim above were run against main before being written.

Docs build clean under `sphinx-build -W`.

Closes #849
2026-09-06 22:39:43 +05:30
..
_static/js Removed trogon feature in favor of sqlite-util-tui 2025-01-10 17:15:02 -08:00
_templates Reformatted CLI examples in docs 2023-05-21 13:57:22 -07:00
.gitignore Initial project layout + database table creation tools 2018-07-28 06:46:17 -07:00
changelog.rst Release 4.2.1 2026-08-13 16:52:30 -07:00
cli-reference.rst Support ANY column types for strict tables 2026-08-12 16:44:01 -07:00
cli.rst transform: coerce empty strings to NULL when converting TEXT columns to numeric types (#805) 2026-08-13 12:56:51 -07:00
codespell-ignore-words.txt Run codespell against source code too, refs #307 2021-08-03 10:06:08 -07:00
conf.py Fixes for Ruff>=0.16.0 (#814) 2026-07-25 14:53:12 -07:00
contributing.rst dependency-groups.dev and uv in docs (#691) 2025-12-11 15:32:00 -08:00
index.rst Add upgrading guide to the documentation 2026-07-04 19:21:34 +00:00
installation.rst Remove sqlean.py support (#772) 2026-07-05 16:00:52 -07:00
Makefile Add reference page to documentation using Sphinx autodoc (#312) 2021-08-10 16:09:28 -07:00
migrations.rst Corrected imports in migrations docs 2026-07-07 11:51:53 -07:00
plugins.rst Unwrap hard-wrapped prose in the documentation 2026-07-04 23:33:48 +00:00
python-api.rst Docs: correct what transform() does to indexes, views and triggers 2026-09-06 22:39:43 +05:30
reference.rst Documentation for compound foreign key support, refs #594 2026-07-05 14:45:08 -07:00
tutorial.ipynb Use double quotes not braces for tables and columns (#678) 2025-11-23 20:43:26 -08:00
upgrading.rst ForeignKey is now a frozen dataclass, restoring hashability 2026-07-06 21:35:45 -07:00