-
-
Notifications
You must be signed in to change notification settings - Fork 248
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
Do not query database for non-spatial tables #125
Conversation
Fix #71 * Add a private SpatialColumnInfo class to manage the spatial column info query and memoization. * Add mocha to test expectations.
I believe the |
* It’s now a proper class. Private classes are not a thing. * Remove unnecessary ‘.rb’ from requires
@srt32 thanks for reviewing. Good point. I made I think this is ready for merge. I'll leave it open for review/comments for another day or so. |
module PostGISAdapter | ||
# Do spatial sql queries for column info and memoize that info. | ||
class SpatialColumnInfo | ||
attr_accessor :adapter, :table_name |
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.
Could these attr_accessor
's become attr_reader
s? Either way, I believe they could also be privatized as they are not used by anything outside of the class.
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.
I removed them in the latest commit.
Do not query database for non-spatial tables
This PR avoids unnecessary SQL queries of
geometry_columns
for tables that do not have any spatial columns.Fix #71
info query and memoization.