generate the db beforehand