Create a new db only when needed.