-
-
Notifications
You must be signed in to change notification settings - Fork 212
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 SRID
for spatial type column definition
#1018
Conversation
SRID
for spatial type column definitionSRID
for spatial type column definition
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.
Very nice work with these changes Jennifer! Just some minor comments/questions. This is looking very close. 👍
sql/geometry.go
Outdated
return Geometry{Inner: inner}, nil | ||
case Geometry: | ||
if err := t.MatchSRID(inner.Inner); err != nil { |
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.
Is there an edge case where Geometry could have its SRID set to something, but its InnerType member could have its SRID set to something else? Probably worth checking to see if we can trigger that condition and considering any guards against that. For example... in MatchSRID, you might want to pass in the Geometry object, check its SRID, then recurse on the InnerType and check its SRID .
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.
You're right! I think it's safe to call MatchSRID with Geometry object itself and recursively check SRID on its inner object. But, Geometry object does not have its own SRID member variable because it can only be either of Point, Linestring or Polygon objects, which they have SRID defined.
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.
Nice work! Code looks great. Just a few very minor comments. 🎉
Added SRID value syntax functionality for column definition.
Added tests cover CREATE TABLE, ALTER TABLE ADD/MODIFY COLUMN, and INSERT statements.
Fixes dolthub/dolt#3425