typeorm-model-generator icon indicating copy to clipboard operation
typeorm-model-generator copied to clipboard

Generator does not run on Views

Open miltonhowe opened this issue 7 years ago • 5 comments

I am using MySQL.

The generator identifies all the tables but it does not see the views. It would be nice if we could generate models for views.

It seems that it would require the generator working on tables without primary keys. I do not think you can add a primary key to a view at least not in MySql.

--edited--

it looks like typeorm itself does not support views or any table without a primary column:

https://github.com/typeorm/typeorm/issues/1135

miltonhowe avatar Feb 14 '18 19:02 miltonhowe

We should wait for typeorm implementation for views and then decide if it can be reverse engineered from db. Typeorm proposal typeorm/typeorm#1024

Kononnable avatar Feb 17 '18 21:02 Kononnable

View entities will be released in 0.2.17 https://github.com/typeorm/typeorm/issues/1024#issuecomment-481316914

pjolayres avatar Apr 13 '19 21:04 pjolayres

@Kononnable : views are implemented in typeorm. Can you include views into model generation?

kzimny avatar Jul 01 '19 13:07 kzimny

Thanks very much for this utility. Is there any update on generating view entities?

queejie avatar Oct 08 '21 16:10 queejie

Just wanted to resurface this. Would love to help draft a PR for this.

aylusltd avatar May 31 '22 16:05 aylusltd