SeaQL / sea-orm

🐚 An async & dynamic ORM for Rust
https://www.sea-ql.org/SeaORM/
Apache License 2.0
7.03k stars 492 forks source link

sea-orm-cli 1.0 doesn't support mysql type: `bit` #2312

Closed uf-fipper closed 1 month ago

uf-fipper commented 1 month ago

thread 'main' panicked at D:\Program Files\rust\cargo\registry\src\rsproxy.cn-0dccff568467c15b\sea-orm-codegen-1.0.0\src\entity\column.rs:80:22: not implemented note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

But when I use 0.12.15, it works.

AntoinePrv commented 1 month ago

Same with Postgres using the migration

.col(
    ColumnDef::new(UploadedFile::Sha256).bit(Some(256))
)

Generates a bit(256) in Postgres, then running sea-orm-cli generate (1.0.0), I run into the same error, originated in this list where Bit is not mentionned. https://github.com/SeaQL/sea-orm/blob/7e433df1716a11e9a99f1bdb2fed35568e10958f/sea-orm-codegen/src/entity/column.rs#L80

I would be cool to have support for a fixed sized rust data type too!

billy1624 commented 1 month ago

Hey everyone, thanks for the report!! Could you please try the PR:

cargo install sea-orm-cli --force --git https://github.com/SeaQL/sea-orm --branch codegen-col-type-resolution