-
Notifications
You must be signed in to change notification settings - Fork 43
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
Columns from views are not filtered out #48
Comments
Should we include views under regular columns, or have a dedicated |
Then you'd have to set a filter for columns in order not to encounter the problem I raised. |
True, we'd have to make a change to fix this issue regardless, just trying to figure out what the ideal long-term solution is 🙂 We either treat "views" as regular tables/columns, but with a flag I guess it's most common to see/interact with them in the same bucket as regular tables, so lets go with that |
@Oreilles For the time being, I'll filter out the views, so it matches the tableInfo method 👍🏻 Then we'll revisit and add proper views support both in here and |
Just as an update: this was recently resolved by knex/knex#4748 |
@azrikahar Knex itself implemented support for views, but that doesn't mean the knex-schema-inspector correctly handles views when querying columnInfo 🙂 |
Yea I think what I mean is that the Knex half is there, so you guys can look into the knex-schema-inspector half (since it seems like you're waiting for this), which is why I only quoted the last few letters of your sentence involving Knex only 😅 Apologies if that wasn't clear enough (or if I even misunderstand this latest message 😵) |
tableInfo()
filters the views out:knex-schema-inspector/lib/dialects/postgres.ts
Line 124 in 01929fb
But
columns()
doesn't, therefore returning columns with tables we can't get info on.Maybe it would be preferable to add a
is_view
attribute to theTable
type and not filter them out silently.The text was updated successfully, but these errors were encountered: