github.com/team-ide/go-dialect@v1.9.20/test/damen_test.go (about)

     1  package test
     2  
     3  import (
     4  	"database/sql"
     5  	"github.com/team-ide/go-dialect/dialect"
     6  	"github.com/team-ide/go-driver/db_dm"
     7  	"testing"
     8  )
     9  
    10  var (
    11  	DMDb      *sql.DB
    12  	DMDialect dialect.Dialect
    13  )
    14  
    15  func initDM() {
    16  	if DMDb != nil {
    17  		return
    18  	}
    19  	dsn := db_dm.GetDSN("SYSDBA", "SYSDBA", "127.0.0.1", 5236)
    20  	var err error
    21  	DMDb, err = db_dm.Open(dsn)
    22  	if err != nil {
    23  		panic(err)
    24  	}
    25  	DMDialect, err = dialect.NewDialect(dialect.TypeDM.Name)
    26  	if err != nil {
    27  		panic(err)
    28  	}
    29  	return
    30  }
    31  
    32  func TestDMLoad(t *testing.T) {
    33  	initDM()
    34  	owners(DMDb, DMDialect)
    35  }
    36  
    37  func TestDMDDL(t *testing.T) {
    38  	initDM()
    39  	//testTableDelete(DMDb, dialect.DM, param, "", getTable().Name)
    40  	testDLL(DMDb, DMDialect, "")
    41  }
    42  
    43  func TestDMSql(t *testing.T) {
    44  	initDM()
    45  	sqlInfo := loadSql("temp/sql_dm.sql")
    46  	testSql(DMDb, DMDialect, "SYSDBA", sqlInfo)
    47  }