collerek / ormar

python async orm with fastapi in mind and pydantic validation
https://collerek.github.io/ormar/
MIT License
1.66k stars 87 forks source link

PostgreSQL Array Columns #273

Closed Lester1989 closed 2 years ago

Lester1989 commented 3 years ago

I really like the Postgres feature of having array type columns. sqlAlchemy supports the PostgreSQL dialect refer: https://docs.sqlalchemy.org/en/14/dialects/postgresql.html?highlight=array#sqlalchemy.dialects.postgresql.ARRAY

It would be nice to use them with ormar like: characteristics:list[str] = ormar.Array(element_type='String') or something like that.

Until that is possible I will use JSON() but it seems to be an overkill

Considering the DRY Principle, this package is the way to go when using a Database for an API. Thank you for that

rajaiswal commented 2 years ago

Any chance this gets any priority?

collerek commented 2 years ago

There is an extension fo postgress https://github.com/tophat/ormar-postgres-extensions by @etimberg (with PR for array in place), but I don't know what is the status of this project, seems idle - so not sure if there are any plans to go further)

etimberg commented 2 years ago

@collerek thanks for the tag. I will work on getting that PR reviewed and merged. I'm open to contributions if other features are needed. So far, I only built what we needed for our services.

rajaiswal commented 2 years ago

@collerek I believe this is now implemented in v2.1.0. Should we mark this as closed?

collerek commented 2 years ago

@rajaiswal Indeed we should close this, thanks for remainder :)