Extract relational methods into chainable query object