Use `BitVec` and `BitArray` from `bitvec` crate for `Bit` and `VarBit` column types
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 9.9k
- Forks
- 735
- Avg merge
- 6h 36m
- Merged PRs (30d)
- 8
Description
Description
Sea ORM uses Vec<u8> for Bit and VarBit with length greater than 1 and bool for length 1 or none. But it should use bitvec::vec::BitVec for VarBit and bitvec::array::BitArray for Bit. Also for postgres types like Inet (can use std::net::IpAddr), Cidr and MacAddress
Steps to Reproduce
- Use a schema with data type
BitorVarBit - Run migration
- Generate scheme
Expected Behavior
generates field with type BitVec or BitArray
Actual Behavior
generates field with type String
Reproduces How Often
Everytime
Workarounds
No idea
Versions
sea-orm version: 1.1.0
OS: Ubuntu 24.04
Database: Postgres 16
Rust version: 1.84 (nightly)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue against PostgreSQL 16 with a schema containing Bit and VarBit, then run the migration and schema-generation steps described in the report. Inspect the generated field types and compare them with the requested bitvec BitVec and BitArray mappings. Done means the generated types no longer fall back to String and the requested PostgreSQL type mappings are addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, rust
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100