piccolo-orm / piccolo

A fast, user friendly ORM and query builder which supports asyncio.
https://piccolo-orm.com/
MIT License
1.41k stars 89 forks source link

Are bit types supported? #985

Closed waldner closed 5 months ago

waldner commented 5 months ago

Postgres has two data types for storing bitstrings, bit and bit varying (see official docs https://www.postgresql.org/docs/current/datatype-bit.html). However, I don't see these documented for piccolo. Are they supported?

dantownsend commented 5 months ago

It's not supported at the moment.

You might be able to create your own custom column type:

https://piccolo-orm.readthedocs.io/en/latest/piccolo/schema/advanced.html#how-to-create-custom-column-types

It looks like asyncpg uses its own asyncpg.BitString type to represent the values:

https://magicstack.github.io/asyncpg/current/usage.html#type-conversion

waldner commented 5 months ago

I'll check the instructions out, thanks.