SeaQL / SeaQL/sea-orm

Breaking changes information missing from ChangeLog

Open
#2,414 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
9.9k
Forks
735
Avg merge
6h 36m
Merged PRs (30d)
8

Description

Upgrading from SeaORM 0.12 to 1.1

There seem to be some changes that are breaking changes but aren't mentioned in the Changelog, which tripped me up during an upgrade. It would be helpful to expand the information in the ChangeLog for others.

  1. The requirement to always define an ActiveModel for a table. In v0.12 I did not implement ActiveModel for some tables because they are read-only, managed directly by some database triggers. In this instance SeaORM defines the schema and I wanted a compile error should somebody try to write code to update the rows.
error[E0412]: cannot find type `ActiveModel` in this scope
 --> table.rs:5:39
  |
5 | #[derive(Copy, Clone, Default, Debug, DeriveEntity)]
  |                                       ^^^^^^^^^^^^
  |
  = note: this error originates in the derive macro `DeriveEntity` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these items

I see it's now written in the doc here that it should always be defined: https://www.sea-ql.org/SeaORM/docs/generate-entity/entity-structure/

  1. ColumnType::String definitions seem to have changed, wrapped by StringLen.
    ColumnType::String(Some(32)).def()

  2. use sea_orm::sea_query::BlobSize has been Dropped, but no indication of what it should have been replaced with.

I guess that ColumnType::Binary(BlobSize::Blob(None)).def() should be ColumnType::Binary(0).def()

ColumnType defines:

    Binary(u32),
    VarBinary(StringLen),

On PostgreSQL should I now be using ColumnType::VarBinary(StringLen::None) or ColumnType::Binary(0).def() or does it matter?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the ChangeLog and the linked entity-structure documentation, then compare the listed SeaORM 0.12-to-1.1 changes: ActiveModel requirements, ColumnType::String, and BlobSize removal. Done means the Changelog clearly records each breaking change and explains the replacement or current API choice where the issue raises alternatives.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.