title: gorm multiple databases connection management
body: <p>I have a requirement where my application talks to different
  databases . How do i manage connections in the gorm.  Is there any
  way gorm supports connection management for multiple database. or i
  need to create  map which holds all database connections.</p>
  <pre><code>if val, ok := selector.issure_db[issuer]; ok {
      return val , nil;
  
  } else {
  
      var dbo  *db.DB;
  
      selector.mu.Lock()
  
      dbo, err := db.NewDb(Config)
  
      if err != nil {
          boot.Logger(ctx).Fatal(err.Error())
      }
  
      selector.issure_db[issuer] = dbo;
  
      selector.mu.Unlock()
  
      return repo ,nil;
  }
  </code></pre>
  <p>Is there is a better way to do this?</p>