Recreate indexes when calling transform when possible (#634)

* Recreate indexes when calling transform when possible and raise an error when they cannot be retained automatically
* Docs for sqlite_utils.db.TransformError

Co-authored-by: Simon Willison <swillison@gmail.com>
This commit is contained in:
Mat Miller 2024-11-23 14:17:15 -06:00 committed by GitHub
commit 42230709f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 153 additions and 1 deletions

View file

@ -1402,6 +1402,8 @@ To keep the original table around instead of dropping it, pass the ``keep_table=
table.transform(types={"age": int}, keep_table="original_table")
This method raises a ``sqlite_utils.db.TransformError`` exception if the table cannot be transformed, usually because there are existing constraints or indexes that are incompatible with modifications to the columns.
.. _python_api_transform_alter_column_types:
Altering column types