Factored repetitive DatabaseConfig validation logic into methods on DatabaseConfig.