-
Notifications
You must be signed in to change notification settings - Fork 21
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
Fix bug 1529388 - don't include column type in autocomplete results. #832
Conversation
@@ -40,6 +40,9 @@ function buildKeywordsFromSchema(schema) { | |||
schema.forEach((table) => { | |||
keywords[table.name] = 'Table'; | |||
table.columns.forEach((c) => { | |||
if (c.length > 0) { | |||
c = c.split('(')[0]; |
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.
If we send this upstream we'll probably want to do something different from pushing the column type info into this string and stripping it back out again like this.
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.
Oh, that's a feature that hasn't been upstreamed since it was denied there. Instead the schema browser rewrite has been started, e.g. @emtwo's schema drawer.
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.
In other words, this is just a fix for 17290cb until we get the schema drawer functionality.
@@ -140,7 +140,7 @@ def _get_tables(self, schema): | |||
AND a.attnum > 0 | |||
AND NOT a.attisdropped | |||
JOIN pg_type t | |||
ON c.reltype = t.oid | |||
ON a.atttypid = t.oid |
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.
Interesting, what was the difference here?
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.
It was showing the table name instead of the column type. Check it out with the Redash metadata data source in the stage or RC environment.
This also fixes an issue with the Postgres query runner not showing the actual column type but the table name.