SeaQL / SeaQL/sea-orm

Use `BitVec` and `BitArray` from `bitvec` crate for `Bit` and `VarBit` column types

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

Nobody has claimed this yet.

Area:type-map
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

  1. Use a schema with data type Bit or VarBit
  2. Run migration
  3. 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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.