- Notifications
You must be signed in to change notification settings - Fork 22k
Add support for pg geometric datatypes point and box #7324
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
Conversation
activerecord/test/cases/base_test.rb Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this fails
This no longer merges cleanly. |
@MSch ping! Any interest in keeping this pull request up to date? |
Would love to but I'm stuck with the data type / oid conversions. I'd need some input by someone knowledable (e.g. @tenderlove) on how to best make those conversions actually work in both directions. |
@MSch try pinging him on twitter. /cc @tenderlove |
@MSch can you please explain the problem you're having starting from the beginning and pretending I have no prior knowldge of the issue? @tenderlove and the other AR maintainers are notoriously overwhelmed with help requests, the more info you can give me and them the better. |
@schneems Thanks I'll do that. And thanks for offering! Had a busy last week, so sorry for the late answer: Postgres has a type point which is a tuple of two floats. I want to add native support to ActiveRecord for this type. When ActiveRecord queries Postgres about the type of such a point column it doesn't return "point" but rather "this is a composite type made up of two floats" (OIDs of data types). I looked through the then current AR code to figure out how to hook into only that and then convert PG point <--> Ruby Array but for some reason I couldn't get it to work. I've seen that my pull request doesn't merge cleanly any more, so maybe something has changed. I'll try again to make this work (since in principle it should be easy IMO) and will come back with some concrete question once I've hit a roadblock. |
@MSch great! Let me know when you are done |
@rafaelfranca This time round I didn't get stuck with the vector conversion like last time. This actually works, but I'm not happy with some of the code. I'm not sure if it wouldn't be better to generally convert all vectors into ruby arrays (like described here
Comments anyone? |
@rafaelfranca ping! it's been a week, i'm anxious :) got any input for me? |
Very interested in this one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why it is instantiate latter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see below.
I've seen postgres range support PR has been merged, any decisions on this one? /cc @tenderlove |
+1 |
@rafaelfranca @tenderlove I've fixed the issue with instantiating Anything else that needs to be done so that this can be merged? |
@rafaelfranca ping :) |
Seems good. Could you add a CHANGELOG entry? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to change it to sql_type
since this method was removed from Column
. See 4b4c8bd
Please rebase against master to get the last code changes on the schema methods and see if the tests are passing |
@rafaelfranca Added CHANGELOG entry. Changed to sql_type, but only in |
Add support for pg geometric datatypes point and box
Thank you. ❤️ 💚 💙 💛 💜 |
I am in favor of liking this. |
Thanks for this code!!! |
@tenderlove https://twitter.com/tenderlove/statuses/231807764907819008
Today I looked into adding support for the postgresql geo types. Everything went well but I didn't manage to get AR to type cast pg's string representation into an array. (See the failing
base_test.rb
)Got a pointer for me?