Revert "Get rid of db dependencies on main"

This reverts commit decbb995a40034dbd8bcfd92b4f8f378f1a81deb.