- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for OpenTestConnection (0.11 sec)
-
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) -
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) -
tests/transaction_test.go
} if err := DB.First(&User{}, "name = ?", user2.Name).Error; err != nil { t.Fatalf("Should find saved record") } } func TestTransactionOnClosedConn(t *testing.T) { DB, err := OpenTestConnection(&gorm.Config{}) if err != nil { t.Fatalf("failed to connect database, got error %v", err) } rawDB, _ := DB.DB() rawDB.Close() if err := DB.Transaction(func(tx *gorm.DB) error { return nil
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Sat Sep 14 12:58:29 UTC 2024 - 12.9K bytes - Viewed (0) -
tests/hooks_test.go
func (p *Product6) BeforeDelete(tx *gorm.DB) error { if err := tx.Delete(&p.Item).Error; err != nil { return err } return nil } func TestPropagateUnscoped(t *testing.T) { _DB, err := OpenTestConnection(&gorm.Config{ PropagateUnscoped: true, }) if err != nil { log.Printf("failed to connect database, got error %v", err) os.Exit(1) } _DB.Migrator().DropTable(&Product6{}, &ProductItem2{})
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Jun 17 03:59:06 UTC 2024 - 16.7K bytes - Viewed (0)