Allowing for Postgres View support#447
Allowing for Postgres View support#447PsySecCorp wants to merge 6 commits intodoctrine:2.1.xfrom PsySecCorp:2.1.x
Conversation
|
Ugh. I was just told 2.1.x is only updated for security fixes only. Before this is rejected and closed, can a concept very similar to this PLEASE be implemented in the current version of Doctrine? These changes show how it can be done. |
|
Why you need all this if you can create an Entity as ReadOnly and achieve the same thing? |
|
PRs should be done in the master branch |
|
@guilhermeblanco read-only entities still generate a table in the SchemaTool, so they cannot be used for views if you want to continue using the SchemaTool. |
There was a problem hiding this comment.
This is wrong. Entities must have an identifier as it is used by the unit of work to store the reference to the entity.
There was a problem hiding this comment.
|
Btw, adding some tests for the features would have shown you that it is broken currently |
|
I'm not a pro at Doctrine and I dont' think I'll ever be one, but I am currently in need of view support when using it. No one else seems to care about this very important SQL standard, so I'm adding what I can based on whatever that I can find. I'll keep plugging at it until I get it right, but I hope this brings up the point that people more familiar with Doctrine should at least acknowledge that views exist and people are using them. |
|
@12Dcode Don't spend time about fixing the feedback in a PR based on 2.1 as this will never be merged in this branch anyway (new features are never added in maintenance branches). |
|
Fundamentally, the issue remains: Can Doctrine be told to treat View records as an entity in all cases except when dealing with schema updates? The only way I found this to be possible was by tweaking the Metadata classes. Can you elaborate how best to do this since I do not possess the necessary mastery of Doctrine to do this as you are suggesting? |
|
Why dont you hook into the "postGenerateSchema" event with a listener and remove the Table instances that are actually views in your database schema? That would easily solve the issue. This is much to scattered a patch for a feature that has little value since a way to handle this already exists. Closing the issue, |
This will allow an Entity to be designated as a view so that it is exempt from schema generation.