Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 17 of 17 for Only (0.15 sec)

  1. tests/migrate_test.go

    						columnType.Name(), columnType.DatabaseTypeName(), dataType, columnType)
    				}
    			}
    		}
    	}
    }
    
    func TestTableType(t *testing.T) {
    	// currently it is only supported for mysql driver
    	if !isMysql() {
    		return
    	}
    
    	const tblName = "cities"
    	const tblSchema = "gorm"
    	const tblType = "BASE TABLE"
    	const tblComment = "foobar comment"
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  2. tests/update_test.go

    		t.Errorf("should only update one record, but got %v", rowsAffected)
    	}
    
    	if rowsAffected := DB.Model(users).Where("age > 0").Update("name", "jinzhu").RowsAffected; rowsAffected != 3 {
    		t.Errorf("should only update one record, but got %v", rowsAffected)
    	}
    }
    
    func TestUpdates(t *testing.T) {
    	users := []*User{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  3. tests/multi_primary_keys_test.go

    		stmt := gorm.Statement{DB: DB}
    		stmt.Parse(&Blog{})
    		stmt.Schema.LookUpField("ID").Unique = true
    		stmt.Parse(&Tag{})
    		stmt.Schema.LookUpField("ID").Unique = true
    		// postgers only allow unique constraint matching given keys
    	}
    
    	DB.Migrator().DropTable(&Blog{}, &Tag{}, "blog_tags", "locale_blog_tags", "shared_blog_tags")
    	if err := DB.AutoMigrate(&Blog{}, &Tag{}); err != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 12.8K bytes
    - Viewed (0)
  4. tests/delete_test.go

    		if count := DB.Model(&users).Association(key).Count(); count != value {
    			t.Errorf("user's %v expects: %v, got %v", key, value, count)
    		}
    	}
    }
    
    // only sqlite, postgres, sqlserver support returning
    func TestSoftDeleteReturning(t *testing.T) {
    	if DB.Dialector.Name() != "sqlite" && DB.Dialector.Name() != "postgres" && DB.Dialector.Name() != "sqlserver" {
    		return
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 10 07:03:34 GMT 2023
    - 9.4K bytes
    - Viewed (0)
  5. tests/query_test.go

    	if result.ID != 0 {
    		t.Errorf("Should not have ID because only selected name, %+v", result.ID)
    	}
    
    	if user.Name != result.Name {
    		t.Errorf("Should have user Name when selected it")
    	}
    
    	var result2 User
    	DB.Where("name = ?", user.Name).Select("name as name").Find(&result2)
    	if result2.ID != 0 {
    		t.Errorf("Should not have ID because only selected name, %+v", result2.ID)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
  6. schema/relationship.go

    	)
    
    	// optimize match english letters and midline
    	// The following code is basically called in for.
    	// In order to avoid the performance problems caused by repeated compilation of regular expressions,
    	// it only needs to be done once outside, so optimization is done here.
    	if idx != -1 && regEnLetterAndMidline.MatchString(str[0:idx]) {
    		name = str[0:idx]
    	} else {
    		name = rel.Schema.namer.RelationshipFKName(*rel)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
  7. tests/sql_builder_test.go

    	updatedAtRe := regexp.MustCompile(`(?i)"updated_at"=".+?"`)
    	actually = updatedAtRe.ReplaceAllString(actually, `"updated_at"=?`)
    	expected = updatedAtRe.ReplaceAllString(expected, `"updated_at"=?`)
    
    	// ignore RETURNING "id" (only in PostgreSQL)
    	returningRe := regexp.MustCompile(`(?i)RETURNING "id"`)
    	actually = returningRe.ReplaceAllString(actually, ``)
    	expected = returningRe.ReplaceAllString(expected, ``)
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
Back to top