Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for OpenTestConnection (0.1 sec)

  1. tests/tests_test.go

    	sqlserverDSN = "sqlserver://sa:LoremIpsum86@localhost:9930?database=master"
    	tidbDSN      = "root:@tcp(localhost:9940)/test?charset=utf8&parseTime=True&loc=Local"
    )
    
    func init() {
    	var err error
    	if DB, err = OpenTestConnection(&gorm.Config{}); err != nil {
    		log.Printf("failed to connect database, got error %v", err)
    		os.Exit(1)
    	} else {
    		sqlDB, err := DB.DB()
    		if err != nil {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Sep 30 03:21:19 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  2. tests/error_translator_test.go

    	}
    }
    
    func TestSupportedDialectorWithErrDuplicatedKey(t *testing.T) {
    	type City struct {
    		gorm.Model
    		Name string `gorm:"unique"`
    	}
    
    	db, err := OpenTestConnection(&gorm.Config{TranslateError: true})
    	if err != nil {
    		t.Fatalf("failed to connect database, got error %v", err)
    	}
    
    	dialectors := map[string]bool{"sqlite": true, "postgres": true, "mysql": true, "sqlserver": true}
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jul 12 13:21:22 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  3. tests/prepared_stmt_test.go

    		t.Fatalf("Failed, got error: %v, rows affected: %v", result.Error, result.RowsAffected)
    	}
    	tx2.Commit()
    }
    
    func TestPreparedStmtDeadlock(t *testing.T) {
    	tx, err := OpenTestConnection(&gorm.Config{})
    	AssertEqual(t, err, nil)
    
    	sqlDB, _ := tx.DB()
    	sqlDB.SetMaxOpenConns(1)
    
    	tx = tx.Session(&gorm.Session{PrepareStmt: true})
    
    	wg := sync.WaitGroup{}
    	for i := 0; i < 100; i++ {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Aug 22 11:02:05 UTC 2024
    - 8.5K bytes
    - Viewed (0)
Back to top