Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for sqlite (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. .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)
  3. 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)
  4. 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)
  5. tests/update_test.go

    	sort.Slice(result.Pets, func(i, j int) bool {
    		return result.Pets[i].ID < result.Pets[j].ID
    	})
    	sort.Slice(result.Team, func(i, j int) bool {
    		return result.Team[i].ID < result.Team[j].ID
    	})
    	sort.Slice(result.Friends, func(i, j int) bool {
    		return result.Friends[i].ID < result.Friends[j].ID
    	})
    	sort.Slice(result2.Pets, func(i, j int) bool {
    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)
  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. tests/helper_test.go

    	}
    }
    
    func isTiDB() bool {
    	return os.Getenv("GORM_DIALECT") == "tidb"
    }
    
    func isMysql() bool {
    	return os.Getenv("GORM_DIALECT") == "mysql"
    }
    
    func isSqlite() bool {
    	return os.Getenv("GORM_DIALECT") == "sqlite"
    }
    
    func db(unscoped bool) *gorm.DB {
    	if unscoped {
    		return DB.Unscoped()
    	} else {
    		return DB
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 8K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. tests/create_test.go

    		CheckPet(t, pet2, pet)
    	})
    
    	t.Run("Slice", func(t *testing.T) {
    		pets := []Pet{{
    			Name: "PolymorphicHasOne-Slice-1",
    			Toy:  Toy{Name: "Toy-PolymorphicHasOne-Slice-1"},
    		}, {
    			Name: "PolymorphicHasOne-Slice-2",
    			Toy:  Toy{Name: "Toy-PolymorphicHasOne-Slice-2"},
    		}, {
    			Name: "PolymorphicHasOne-Slice-3",
    			Toy:  Toy{Name: "Toy-PolymorphicHasOne-Slice-3"},
    		}}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
Back to top