Closed Saint-Riversmith closed 2 years ago
This isn't something that this library is intended for, it's just for one-to-one mappings of database fields, nothing more fancy than that.
Overriding the type of the column wouldn't do much good as the data from the foreign table hasn't been fetched, it would remain as the number.
Greetings,
I have yet to find a way to automatically map relationship between entities while syncing from a database. Consider the two following entities as examples:
In this case, the "Client" property of the TicketEntity interface refers to an instance of ClientEntity, and it is marked as such in the DB by foreign key. Is there a way to change it so that the "Client" property is of type "ClientEntity" instead of the current "number", without overiding every relationship property in all of my models one by one?
The database is PostgreSQL, in case this affects anything.