-
Notifications
You must be signed in to change notification settings - Fork 240
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
Warn about PostgreSQL FDW on introspection #4441
Comments
Go for it! We currently do not have the time to work on these warnings, or "stopgaps" as we call them internally. So if you find a good way to identify a FDW during Introspection, the pumbling from #3953 for the warnings should be the perfect approach. |
Last week I found #4020, which seems like it implements the stopgap (but is failing a test on an old version of postgres). Not sure if this is the only reason it wasn't merged, possibly it was forgotten because it's not associated with the right related issue. Anyways, I'm gonna get it to pass rather than building out my own solution |
That sounds like a reasonable assumption. @Druue, can you provide context? |
Hey @JEbertPrime so I tried to re-build my context for this 😅. Prisma minimally supports Postgres They currently render as follows: /// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by Prisma Client.
/// This model represents a foreign data wrapper which requires additional setup for migrations. Visit https://pris.ly/d/fdw for more info.
// model bar {
// id Int @default(autoincrement())
// @@ignore
// } Next step to me would be:
Feel free to reach out if you have further questions :) |
This issue is for tracking an item in prisma/prisma#16311 (discussed in depth here), related to foreign data wrappers in PostgreSQL databases.
The problem
Foreign tables in PostgreSQL databases occasionally have different properties from normal tables. As such they are left out of the query in schema-engine/sql-schema-describer/src/postgres/tables_query.sql during introspection, but ideally the user would be warned when a foreign table is left out.
The solution
#3953 is a similar PR, and the same general process can probably be implemented for this. Foreign tables can be queried for in the database and identified, and a warning message can notify users that they are present in the database but won't be represented in their schemas.
I'm not particularly savvy with rust, but this process seems straightforward enough that I'd be happy to submit a PR if nobody more experienced has the time - I know the issue on the prisma repo is referenced on the roadmap, but it seems pretty low priority so I'd be happy to take it on
The text was updated successfully, but these errors were encountered: