database building and dependency, basically from korma example