prisma / prisma

Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
https://www.prisma.io
Apache License 2.0
38.97k stars 1.53k forks source link

Introspection: Ignore/Skip cross schema foreign keys #10113

Open janpio opened 2 years ago

janpio commented 2 years ago

Right now Introspection of a database schema with cross schema foreign keys fails because Prisma only supports a singular schema, not querying across multiple schemas. Obviously this is planned via #1122, but as it is quite a big change there might be a possible step in between:

We could ignore cross schema foreign keys during Introspection and just not render these relations. The relation scalar fields would still be present and could bet set with the foreign key value manually by the user.

iAmWillShepherd commented 2 years ago

Any updates on when this will get addressed? #1122 has been open for two years, yet there is no mention of this on the roadmap. I've just been bitten in the ass by this. Sure, it's my fault for not doing my due diligence on support, but I think myself and many others assumed this would be possible given how common it is to "namespace" tables under different schemas.

It's OK if this isn't a priority for the team, but I think y'all should do a better job communicating what you will or won't do. IMO, lack of multi-schema support should be in BIG bold letters, so people don't waste their time with a tool that suits their needs.

floelhoeffel commented 2 years ago

Superseded by #1122

zpg6 commented 2 years ago

We could ignore cross schema foreign keys during Introspection and just not render these relations. The relation scalar fields would still be present and could be set with the foreign key value manually by the user.

Sounds to me like a few lines of code, @janpio have you experimented with this workaround on a branch somewhere?

janpio commented 2 years ago

No, we are working on fixing the problem as a whole (https://github.com/prisma/prisma/issues/1122), and decided not to pursue this.