ngyv / re-modelr

A simple-to-use pure javascript object-relational mapping to manage data.
MIT License
0 stars 0 forks source link

Attributes descriptor functions instead of hash #8

Closed ngyv closed 6 years ago

ngyv commented 6 years ago

Something like

{
  id: type('number', { required: true }),
  name:  type('string', { default: 'Nurul' }),
  account: belongTo('account'), // not v1.0.0
  hobbies: hasMany('hobby', { async: true }), // not v1.0.0
  partner: hasOne('user', { recursive: true }) // not v1.0.0
}