Files
SpacetimeDB/crates/table
Phoebe Goldman aeeb35f0bb Improve error reporting for invalid column-type-changing automigrations (#3202)
# Description of Changes

Title. When validating column type changes in `Table::change_columns_to`
and comparing layouts in `RowTypeLayout::is_compatible_with`, return
structured error objects which describe the mismatch.

I made this change while debugging the issue that led to #3203 , where
`change_columns_to` returned an error during replay of an automigration
which had succeeded the first time. The original error contained enough
information to debug, but it was presented in a noisy and unhelpful way,
so I wrote this patch to get better diagnostics.

Per @Centril 's comments, these errors are for internal assertions, not
user-facing error reporting, so we value fail-fast rather than error
hygiene and choose not to use the `ErrorStream` combinator.

Also note that I sprinkled `Box`es around some large-ish error types to
quiet
https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err
.

# API and ABI breaking changes

N/a

# Expected complexity level and risk

1.

# Testing

Manual testing with BitCraft. As this is purely altering the error
reporting for non-user-facing assertions, I don't believe any further
testing is necessary.
2025-08-29 17:02:27 +00:00
..
2025-08-12 18:20:58 +00:00

⚠️ Internal Crate ⚠️

This crate is intended for internal use only. It is not stable and may change without notice.