Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support array datatype in PostgreSQL #1132

Merged
merged 10 commits into from
Oct 23, 2022
Merged

Support array datatype in PostgreSQL #1132

merged 10 commits into from
Oct 23, 2022

Conversation

billy1624
Copy link
Member

@billy1624 billy1624 commented Oct 19, 2022

PR Info

Adds

  • postgres-array feature
  • ColumnType::Array variant
  • Conversion between sea_query::ColumnType::Array and sea_orm::ColumnType::Array
  • Support Vec<T> to be used as model fields in PostgreSQL

@billy1624 billy1624 self-assigned this Oct 19, 2022
Copy link
Member Author

@billy1624 billy1624 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two conversion look ugly. But I cannot convert it with Into<T>. Because the ColumnType is behind a Rc / Arc so I cannot take ownership of the ColumnType, that blocking me from using Into<T>.

Maybe there is another way around it. Any suggestion?

@billy1624 billy1624 marked this pull request as ready for review October 19, 2022 14:08
@billy1624
Copy link
Member Author

Hey @tyt2y3, ready for review. Do you think we need to support entity generation of PostgreSQL's array datatypes?

@billy1624
Copy link
Member Author

We can merge this first. I'll create other PRs for the CLI support :)

@billy1624
Copy link
Member Author

Okay, I managed to refactor it @tyt2y3

@tyt2y3 tyt2y3 merged commit b5b9790 into master Oct 23, 2022
@tyt2y3 tyt2y3 deleted the pg-array branch October 23, 2022 10:27
@ikrivosheev
Copy link
Member

@tyt2y3 hello! Where do you find the sea-schema package with version: 0.10.1?)

@tyt2y3
Copy link
Member

tyt2y3 commented Oct 23, 2022

I just released it on cargo and went to dinner )
Now pushed to github

billy1624 added a commit to SeaQL/seaql.github.io that referenced this pull request Oct 31, 2022
tyt2y3 added a commit to SeaQL/seaql.github.io that referenced this pull request Nov 1, 2022
* What's new in SeaORM 0.10.1

* Edit

* Error handling (SeaQL/sea-orm#1002)

* Support array datatype for Postgres (SeaQL/sea-orm#1132)

* generate index file as `lib.rs` instead of `mod.rs` (SeaQL/sea-orm#953)

* Running migration on any Postgres schema (SeaQL/sea-orm#1056)

* More connection options (SeaQL/sea-orm#897, SeaQL/sea-orm#1056)

* Implements `TryFrom<ActiveModel>` for `Model` (SeaQL/sea-orm#990)

* Delete 2022-10-28-whats-new-in-0.10.1.md

Co-authored-by: Chris Tsang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Be able to support Array in database
3 participants