a rough sketch of some ORM functionality