brianloveswords / streamsql

A streaming, backend agnostic SQL ORM heavily inspired by levelup
MIT License
67 stars 7 forks source link

Relationship conditions #25

Open davidguttman opened 9 years ago

davidguttman commented 9 years ago

Could be useful to add conditions to a relationship:

relationships: {
  recentAlbums: {
    type: 'hasMany',
    local: 'id',
    foreign: { table: 'album', key: 'bandId' },
    conditions: {
      released: {
        operation: '>=',
        value: 2012
      }
    }
  }

Thoughts?

wunderlink commented 9 years ago

+1