You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: helper.go
    path of file: ./repos/faygo/ext/db/xorm
    
    the code of the file until where you have to start completion: package xorm

import (
	"errors"

	"github.com/andeya/faygo"
	"xorm.io/xorm"
)

// MustDB gets the specified database engine,
// or the default DB if no name is specified.
func MustDB(name ...string) *xorm.Engin
    
func TransactCallbackByName(dbName string, fn func(*xorm.Session) error, session ...*xorm.Session) (err error) {
	if fn == nil {
		return
	}
	var sess *xorm.Session
	if len(session) > 0 {
		sess = session[0]
	}
	if sess == nil {
		engine, ok := DB(dbName)
		if !ok {
			return errors.New("[xorm] the database engine `" + dbName + "` is not configured")
		}
		sess = engine.NewSession()
		err = sess.Begin()
		if err != nil {
			sess.Close()
			return
		}
		defer func() {
			if err != nil {
				sess.Rollback()
			} else {
				err = sess.Commit()
			}
			sess.Close()
		}()
	}
	err = fn(sess)
	return
}