Added functionality to create databases if they do not exist