link db with controller