Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for sollte (0.15 sec)

  1. tests/embedded_struct_test.go

    	type AdvancedUser struct {
    		EmbUser  `gorm:"embedded"`
    		Advanced bool
    	}
    
    	DB.Migrator().DropTable(&AdvancedUser{})
    
    	if err := DB.AutoMigrate(&AdvancedUser{}); err != nil {
    		if DB.Dialector.Name() != "sqlite" {
    			t.Errorf("Failed to auto migrate advanced user, got error %v", err)
    		}
    	}
    }
    
    func TestEmbeddedTagSetting(t *testing.T) {
    	type Tag1 struct {
    		Id int64 `gorm:"autoIncrement"`
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Oct 26 03:58:13 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  2. migrator/migrator.go

    		str := stmt.Quote(opt.DBName)
    		if opt.Expression != "" {
    			str = opt.Expression
    		} else if opt.Length > 0 {
    			str += fmt.Sprintf("(%d)", opt.Length)
    		}
    
    		if opt.Collate != "" {
    			str += " COLLATE " + opt.Collate
    		}
    
    		if opt.Sort != "" {
    			str += " " + opt.Sort
    		}
    		results = append(results, clause.Expr{SQL: str})
    	}
    	return
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  3. .github/workflows/tests.yml

    name: tests
    
    on:
      push:
        branches-ignore:
          - 'gh-pages'
      pull_request:
        branches-ignore:
          - 'gh-pages'
    
    permissions:
      contents: read
    
    jobs:
      # Label of the container job
      sqlite:
        strategy:
          matrix:
            go: ['1.21', '1.20', '1.19']
            platform: [ubuntu-latest] # can not run in windows OS
        runs-on: ${{ matrix.platform }}
    
        steps:
        - name: Set up Go 1.x
    Others
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Jan 29 02:34:20 GMT 2024
    - 6.6K bytes
    - Viewed (0)
  4. tests/table_test.go

    		t.Errorf("Table with escape character, got %v", r.Statement.SQL.String())
    	}
    
    	r = dryDB.Create(&UserWithTable{}).Statement
    	if DB.Dialector.Name() != "sqlite" {
    		if !regexp.MustCompile(`INSERT INTO .gorm.\..user. (.*name.*) VALUES (.*)`).MatchString(r.Statement.SQL.String()) {
    			t.Errorf("Table with escape character, got %v", r.Statement.SQL.String())
    		}
    	} else {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Mar 09 09:31:28 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  5. tests/migrate_test.go

    		t.Fatalf("Found deleted column")
    	}
    }
    
    func TestMigrateColumns(t *testing.T) {
    	tidbSkip(t, "use another test case")
    
    	sqlite := DB.Dialector.Name() == "sqlite"
    	sqlserver := DB.Dialector.Name() == "sqlserver"
    
    	type ColumnStruct struct {
    		gorm.Model
    		Name  string
    		Age   int    `gorm:"default:18;comment:my age"`
    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)
  6. tests/preload_suits_test.go

    		t.Errorf("got %s; want %s", toJSONString(got), toJSONString(want))
    	}
    }
    
    func TestManyToManyPreloadWithMultiPrimaryKeys(t *testing.T) {
    	if name := DB.Dialector.Name(); name == "sqlite" || name == "sqlserver" {
    		t.Skip("skip sqlite, sqlserver due to it doesn't support multiple primary keys with auto increment")
    	}
    
    	type (
    		Level1 struct {
    			ID           uint   `gorm:"primary_key;"`
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Mar 18 05:38:46 GMT 2022
    - 30.3K bytes
    - Viewed (0)
  7. schema/index.go

    					Option:  settings["OPTION"],
    					Fields: []IndexOption{{
    						Field:      field,
    						Expression: settings["EXPRESSION"],
    						Sort:       settings["SORT"],
    						Collate:    settings["COLLATE"],
    						Length:     length,
    						priority:   priority,
    					}},
    				})
    			}
    		}
    	}
    
    	err = nil
    	return
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  8. schema/index_test.go

    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils/tests"
    )
    
    type UserIndex struct {
    	Name         string `gorm:"index"`
    	Name2        string `gorm:"index:idx_name,unique"`
    	Name3        string `gorm:"index:,sort:desc,collate:utf8,type:btree,length:10,where:name3 != 'jinzhu'"`
    	Name4        string `gorm:"uniqueIndex"`
    	Name5        int64  `gorm:"index:,class:FULLTEXT,comment:hello \\, world,where:age > 10"`
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 8K bytes
    - Viewed (0)
  9. tests/multi_primary_keys_test.go

    	sort.Strings(contents)
    	return reflect.DeepEqual(tagContents, contents)
    }
    
    func TestManyToManyWithMultiPrimaryKeys(t *testing.T) {
    	if name := DB.Dialector.Name(); name == "sqlite" || name == "sqlserver" {
    		t.Skip("skip sqlite, sqlserver due to it doesn't support multiple primary keys with auto increment")
    	}
    
    	if name := DB.Dialector.Name(); name == "postgres" {
    		stmt := gorm.Statement{DB: DB}
    		stmt.Parse(&Blog{})
    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)
  10. tests/error_translator_test.go

    		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}
    	if supported, found := dialectors[db.Dialector.Name()]; !(found && supported) {
    		return
    	}
    
    	DB.Migrator().DropTable(&City{})
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Jul 12 13:21:22 GMT 2023
    - 3.1K bytes
    - Viewed (0)
Back to top