autogenerating database