Resolve to db and relations