norm
norm copied to clipboard
ability mapping model's field to different column name
is there a way to change column name of model in database?
Out of curiosity, what would be the point of that ?
Out of curiosity, what would be the point of that ?
Probably connecting Norm to an existing table.
This can be implemented in a similar manner to tableName
pragma: https://github.com/moigagoo/norm/pull/123/
Probably connecting Norm to an existing table.
I can fully confirm that this would be the usecase, at least for me.
In my case, I've got a table generated from another framework from which I'm rewriting the backend. That gave me lots of columns with an _id
suffix.
Currently I'm writing my models in a way that I have an entire instance of a Campaign
object sitting behind a fieldName of campaign_id
, which is a somewhat confusing read for somebody uninitiated.
Same here. If Norm had more support for using existing databases, I would definitely consider to use it in many more places.
I'll take a look at this. Shouldn't be too hard.
However, custom primary keys have higher priority to me.