code: func (cd *ConnectionDetails) Finalize() error {
  	cd.Dialect = normalizeSynonyms(cd.Dialect)
  
  	if cd.Options == nil { // for safety
  		cd.Options = make(map[string]string)
  	}
  
  	// Process the database connection string, if provided.
  	if cd.URL != "" {
  		if err := cd.withURL(); err != nil {
  			return err
  		}
  	}
  
  	if fin, ok := finalizer[cd.Dialect]; ok {
  		fin(cd)
  	}
  
  	if DialectSupported(cd.Dialect) {
  		if cd.Database != "" || cd.URL != "" {
  			return nil
  		}
  		return errors.New("no database or URL specified")
  	}
  	return errors.Errorf("unsupported dialect '%v'", cd.Dialect)
  }
docs: // Finalize cleans up the connection details by normalizing names,
  // filling in default values, etc...