Allow database to be lazy-initialized by passing a proc