code: func (cd *ConnectionDetails) withURL() error {
  	ul := cd.URL
  	if cd.Dialect == "" {
  		if dialectX.MatchString(ul) {
  			// Guess the dialect from the scheme
  			dialect := ul[:strings.Index(ul, ":")]
  			cd.Dialect = normalizeSynonyms(dialect)
  		} else {
  			return errors.New("no dialect provided, and could not guess it from URL")
  		}
  	} else if !dialectX.MatchString(ul) {
  		ul = cd.Dialect + "://" + ul
  	}
  
  	if !DialectSupported(cd.Dialect) {
  		return errors.Errorf("unsupported dialect '%s'", cd.Dialect)
  	}
  
  	// warning message is required to prevent confusion
  	// even though this behavior was documented.
  	if cd.Database+cd.Host+cd.Port+cd.User+cd.Password != "" {
  		log(logging.Warn, "One or more of connection details are specified in database.yml. Override them with values in URL.")
  	}
  
  	if up, ok := urlParser[cd.Dialect]; ok {
  		return up(cd)
  	}
  
  	// Fallback on generic parsing if no URL parser was found for the dialect.
  	u, err := url.Parse(ul)
  	if err != nil {
  		return errors.Wrapf(err, "couldn't parse %s", ul)
  	}
  	cd.Database = strings.TrimPrefix(u.Path, "/")
  
  	hp := strings.Split(u.Host, ":")
  	cd.Host = hp[0]
  	if len(hp) > 1 {
  		cd.Port = hp[1]
  	}
  
  	if u.User != nil {
  		cd.User = u.User.Username()
  		cd.Password, _ = u.User.Password()
  	}
  	cd.RawOptions = u.RawQuery
  
  	return nil
  }
docs: // withURL parses and overrides all connection details with values
  // from standard URL except Dialect. It also calls dialect specific
  // URL parser if exists.