code: func NewSchemaSource(uri string) (SchemaSource, error) {
  	// "-" is a special source, denoting stdin.
  	if uri == "-" {
  		return NewReaderSource(os.Stdin), nil
  	}
  
  	u, err := url.Parse(uri)
  	if err != nil {
  		return nil, errors.Wrap(err, `failed to parse uri`)
  	}
  
  	switch strings.ToLower(u.Scheme) {
  	case "local-git":
  		// local-git:///path/to/dir?file=foo&commitish=bar
  		q := u.Query()
  		return NewLocalGitSource(u.Path, q.Get("file"), q.Get("commitish")), nil
  	case "mysql":
  		// Treat the argument as a DSN for mysql.
  		// DSN is everything after "mysql://", so let's be lazy
  		// and use everything after the second slash
  		return NewMySQLSource(uri[8:]), nil
  	case "file", "":
  		// Eh, no remote host, please
  		if u.Host != "" && u.Host != "localhost" {
  			return nil, errors.Wrap(err, `remote hosts for file:// sources are not supported`)
  		}
  		return NewLocalFileSource(u.Path), nil
  	}
  
  	return nil, errors.New("invalid source")
  }
docs: // NewSchemaSource creates a SchemaSource based on the given URI.
  // Currently "-" (for stdin), "local-git://...", "mysql://...", and
  // "file://..." are supported. A string that does not match any of
  // the above patterns and has no scheme part is treated as a local file.