code: func ValidateDBConfig(cfg DBConfig) error {
  	err := vala.BeginValidation().Validate(
  		vala.StringNotEmpty(cfg.DB, "db"),
  		vala.StringNotEmpty(cfg.User, "user"),
  		vala.StringNotEmpty(cfg.Host, "host"),
  		vala.Not(vala.Equals(cfg.Port, 0, "port")),
  		vala.StringNotEmpty(cfg.DBName, "dbname"),
  		vala.StringNotEmpty(cfg.SSLMode, "sslmode"),
  	).Check()
  	if err != nil {
  		return err
  	}
  
  	if cfg.DB != "postgres" && cfg.DB != "mysql" {
  		return errors.New("not a valid driver name")
  	}
  
  	return nil
  }
docs: // ValidateDBConfig returns an error if any of the required db config
  // fields are not set to their appropriate values.