-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Support PostgreSQL native inheritance #10739
Comments
Note that table inheritance is no longer recommended by PostgreSQL: https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don.27t_use_table_inheritance |
I don't understand why this "fad" is a bad idea. How would you map foreign keys/tables to hierarchical domain models? |
Make sure to talk to @roji before starting any work on this. |
To allow this and other similar patterns the creation of |
PostgreSQL natively supports table inheritance in the database (see docs here, and also some current caveats). In theory EF Core could map CLR inheritance relations to this scheme as an additional alternative to TPH/TPC/TPT.
capitals
)INHERITS FROM
another table (cities
).capitals
) implicitly contains fields from the parent (cities
), so to get capitals you only need to select from the child table. In that sense it's like TPC.SELECT ... FROM ONLY CITIES
syntax can return only the parents.Requested in npgsql/efcore.pg#59 and this SO.
Disclaimer: I'm opening this after a conversation with @divega in which he expressed interest, but I imagine the internal impact would be really non-trivial and beyond what you'd want to provide.
The text was updated successfully, but these errors were encountered: