-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add Support For Postgres Vec<T> #159
Conversation
@karatakis would love your review on this whenever you're able -- thank you for all the work you've put into this project! |
Thanks, @jsievenpiper, for taking the time to commit to our project. I will review your code, propose solutions, and determine if it meets our standards. If everything is okay, I will continue to merge it 😄 |
@jsievenpiper, everything looks okay. It's a pass from me if the tests are green. Please take some care to cover the clippy and fmt issues so I can contribute to merging it. Regarding your thoughts about the nested arrays, they are valid but can be implemented in a separate issue. PS: rebase with main branch, as there are some tests breaking in pgsql that is not your fault. |
@karatakis rebased and fmt/clipped! If there are other test failures after that rebase I'm happy to take a look into them! |
I'll take a look at the test suite and see what needs adjusting. |
@jsievenpiper, it causes a bit of disturbance on the integration tests. I must determine if this behavior is expected or not to modify the tests. |
@karatakis took a look at the integration tests and found a small bug in the PR for mutations -- I ran the postgres suite manually and fixed the PR. I think it should fix the other backends as well. No test suite changes should be needed! |
@jsievenpiper, thanks for the work. Your contributions are significant and will be shipped with the 1.0.0 version. |
@karatakis my pleasure! Thank you for all for creating such a great project! |
This has been an awesome project to use and I was hoping to give a little bit back to it!
PR Info
New Features
Adds support for arbitrarily-nested
Vec
types. Makes some assumptions about nullability in cases where the underlying database doesn't have nested nullability concerns. There's also some limitations in how nullability is held at the sea_query level that doesn't directly map to GraphQL's granularity. I'm happy for those assumptions to be changed to whatever the team supporting SeaORM/Seaography thinks makes the most sense.Based on #128, I'm not certain every possible use case is covered (e.g. filtering on the data in the vec types), but figured they are at least queryable and renderable now, which is a good start!
You can now have an
Entity
like so:This will become the GraphQL type:
[String!]!
. Comments on nullability above, but right now it only applies to theVec
itself (e.g. a nullable column would result in[String!]
because we don't have insight into whether the innerString
can be null or not).And you can query it:
And get it back:
This works for any allowed nested type defined by the sea_query
ColumnType
that is also supported by Seaography, not just strings!Bug Fixes
Breaking Changes
Changes
Did some light refactoring to pull duplication down in the files I mucked around in.