Check if database exists