Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for isTiDB (0.23 sec)

  1. tests/helper_test.go

    				"Birthday", "CompanyID", "ManagerID", "Active")
    		}
    	})
    }
    
    func tidbSkip(t *testing.T, reason string) {
    	if isTiDB() {
    		t.Skipf("This test case skipped, because of TiDB '%s'", reason)
    	}
    }
    
    func isTiDB() bool {
    	return os.Getenv("GORM_DIALECT") == "tidb"
    }
    
    func isMysql() bool {
    	return os.Getenv("GORM_DIALECT") == "mysql"
    }
    
    func isSqlite() bool {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 8K bytes
    - Viewed (0)
  2. tests/sql_builder_test.go

    		t.Fatalf("Failed to scan age, got %v", err)
    	}
    
    	if age != 10 {
    		t.Errorf("Scan with Row, age expects: %v, got %v", user2.Age, age)
    	}
    
    	table := "gorm.users"
    	if DB.Dialector.Name() != "mysql" || isTiDB() {
    		table = "users" // other databases doesn't support select with `database.table`
    	}
    
    	DB.Table(table).Where(map[string]interface{}{"name": user2.Name}).Update("age", 20)
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
  3. tests/migrate_test.go

    	}
    
    	if DB.Migrator().HasIndex(&IndexStruct{}, "idx_users_name_1") {
    		t.Fatalf("Should not find index for user's name after delete")
    	}
    }
    
    func TestTiDBMigrateColumns(t *testing.T) {
    	if !isTiDB() {
    		t.Skip()
    	}
    
    	// TiDB can't change column constraint and has auto_random feature
    	type ColumnStruct struct {
    		ID    int `gorm:"primarykey;default:auto_random()"`
    		Name  string
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
Back to top