jackc / pgx

PostgreSQL driver and toolkit for Go
MIT License
10.84k stars 846 forks source link

Support directly inserting pgtype.Bits into a column of type BIT(n) using named args #2079

Open Mikephii opened 4 months ago

Mikephii commented 4 months ago

Is your feature request related to a problem? Please describe.

Right now if i try and directly insert pgtype.Bits into column of type BIT(n) using named args i get an incorrect binary type error. as a solution im converting my pgtype.Bits into strings of "1"s and "0"s like "1010011...1111001"

Describe the solution you'd like

Ideally pgtype.Bits -> Bit(n) is supported. scanning from a query result into a pgtype.bits works funnily enough (BIT(n) -> pgtype.Bits)