code: func NewDB(conn *sql.DB) (*DB, error) {
  	db, err := gorm.Open(DBDriver, conn)
  	if err != nil {
  		return nil, err
  	}
  
  	m := migrate.NewPostgresMigrator(conn)
  	// Run all migrations in a single transaction, so they will be rolled
  	// back as one. This is almost always the behavior that users would want
  	// when upgrading Empire. If a new release has multiple migrations, and
  	// one of those fails, it's easier for them if the entire upgrade rolls
  	// back instead of getting stuck in failed state.
  	m.TransactionMode = migrate.SingleTransaction
  
  	return &DB{
  		DB:       &db,
  		migrator: m,
  	}, nil
  }
docs: // NewDB wraps a sql.DB instance as a DB.