Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for Sait (0.72 sec)

  1. tests/prepared_stmt_test.go

    	for i := 0; i < 100; i++ {
    		wg.Add(1)
    		go func() {
    			user := User{Name: "jinzhu"}
    			tx.Create(&user)
    
    			var result User
    			tx.First(&result)
    			wg.Done()
    		}()
    	}
    	wg.Wait()
    
    	conn, ok := tx.ConnPool.(*gorm.PreparedStmtDB)
    	AssertEqual(t, ok, true)
    	AssertEqual(t, len(conn.Stmts), 2)
    	for _, stmt := range conn.Stmts {
    		if stmt == nil {
    			t.Fatalf("stmt cannot bee nil")
    		}
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Mar 21 07:55:43 UTC 2024
    - 4K bytes
    - Viewed (0)
  2. tests/preload_test.go

    			defer wg.Done()
    			var user2 []User
    			tx := DB.Where("id = ?", 1).Session(&gorm.Session{})
    
    			if err := tx.Preload("Team").Find(&user2).Error; err != nil {
    				t.Error(err)
    			}
    		}()
    	}
    	wg.Wait()
    }
    
    func TestPreloadWithDiffModel(t *testing.T) {
    	user := *GetUser("preload_with_diff_model", Config{Account: true})
    
    	if err := DB.Create(&user).Error; err != nil {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:00:47 UTC 2024
    - 15.9K bytes
    - Viewed (0)
  3. prepare_stmt.go

    		db.Mux.RUnlock()
    		// wait for other goroutines prepared
    		<-stmt.prepared
    		if stmt.prepareErr != nil {
    			return Stmt{}, stmt.prepareErr
    		}
    
    		return *stmt, nil
    	}
    	db.Mux.RUnlock()
    
    	db.Mux.Lock()
    	// double check
    	if stmt, ok := db.Stmts[query]; ok && (!stmt.Transaction || isTransaction) {
    		db.Mux.Unlock()
    		// wait for other goroutines prepared
    		<-stmt.prepared
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Mar 28 08:47:39 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  4. schema/schema.go

    	} else {
    		schemaCacheKey = modelType
    	}
    
    	// Load exist schema cache, return if exists
    	if v, ok := cacheStore.Load(schemaCacheKey); ok {
    		s := v.(*Schema)
    		// Wait for the initialization of other goroutines to complete
    		<-s.initialized
    		return s, s.err
    	}
    
    	modelValue := reflect.New(modelType)
    	tableName := namer.TableName(modelType.Name())
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:52:33 UTC 2024
    - 13.7K bytes
    - Viewed (0)
  5. .github/workflows/tests.yml

            env:
              POSTGRES_PASSWORD: gorm
              POSTGRES_USER: gorm
              POSTGRES_DB: gorm
              TZ: Asia/Shanghai
            ports:
              - 9920:5432
            # Set health checks to wait until postgres has started
            options: >-
              --health-cmd pg_isready
              --health-interval 10s
              --health-timeout 5s
              --health-retries 5
    
        steps:
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 09:24:34 UTC 2024
    - 6.6K bytes
    - Viewed (0)
Back to top