Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for sqlite3 (0.18 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. tests/upsert_test.go

    		}
    	}
    }
    
    func TestUpsertSlice(t *testing.T) {
    	langs := []Language{
    		{Code: "upsert-slice1", Name: "Upsert-slice1"},
    		{Code: "upsert-slice2", Name: "Upsert-slice2"},
    		{Code: "upsert-slice3", Name: "Upsert-slice3"},
    	}
    	DB.Clauses(clause.OnConflict{DoNothing: true}).Create(&langs)
    
    	var langs2 []Language
    	if err := DB.Find(&langs2, "code LIKE ?", "upsert-slice%").Error; err != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Sep 05 07:39:19 GMT 2022
    - 11.4K 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. tests/update_test.go

    		t.Errorf("failed to find created record, got error: %v, result: %+v", err, result4)
    	}
    }
    
    // only sqlite, postgres, sqlserver support returning
    func TestUpdateReturning(t *testing.T) {
    	if DB.Dialector.Name() != "sqlite" && DB.Dialector.Name() != "postgres" && DB.Dialector.Name() != "sqlserver" {
    		return
    	}
    
    	users := []*User{
    		GetUser("update-returning-1", Config{}),
    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)
  8. 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)
  9. tests/tests_test.go

    	case "tidb":
    		log.Println("testing tidb...")
    		if dbDSN == "" {
    			dbDSN = tidbDSN
    		}
    		db, err = gorm.Open(mysql.Open(dbDSN), cfg)
    	default:
    		log.Println("testing sqlite3...")
    		db, err = gorm.Open(sqlite.Open(filepath.Join(os.TempDir(), "gorm.db")), cfg)
    		if err == nil {
    			db.Exec("PRAGMA foreign_keys = ON")
    		}
    	}
    
    	if err != nil {
    		return
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 3.3K bytes
    - Viewed (1)
  10. 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)
Back to top