Simple and Powerful ORM for Go, support mysql,postgres,tidb,sqlite3,sqlite,mssql,oracle,cockroach https://xorm.io
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

35 lines
774 B

// Copyright 2020 The Xorm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package integrations
import (
"testing"
"xorm.io/xorm"
"xorm.io/xorm/log"
"xorm.io/xorm/schemas"
"github.com/stretchr/testify/assert"
)
func TestEngineGroup(t *testing.T) {
assert.NoError(t, PrepareEngine())
master := testEngine.(*xorm.Engine)
if master.Dialect().URI().DBType == schemas.SQLITE {
t.Skip()
return
}
eg, err := xorm.NewEngineGroup(master, []*xorm.Engine{master})
assert.NoError(t, err)
eg.SetMaxIdleConns(10)
eg.SetMaxOpenConns(100)
eg.SetTableMapper(master.GetTableMapper())
eg.SetColumnMapper(master.GetColumnMapper())
eg.SetLogLevel(log.LOG_INFO)
eg.ShowSQL(true)
}