Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for Kuwait (0.23 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")
    		}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 07:55:43 GMT 2024
    - 4K bytes
    - Viewed (0)
  2. 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
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 28 08:47:39 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  3. clause/locking.go

    package clause
    
    const (
    	LockingStrengthUpdate    = "UPDATE"
    	LockingStrengthShare     = "SHARE"
    	LockingOptionsSkipLocked = "SKIP LOCKED"
    	LockingOptionsNoWait     = "NOWAIT"
    )
    
    type Locking struct {
    	Strength string
    	Table    Table
    	Options  string
    }
    
    // Name where clause name
    func (locking Locking) Name() string {
    	return "FOR"
    }
    
    // Build build where clause
    func (locking Locking) Build(builder Builder) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:32:56 GMT 2023
    - 773 bytes
    - Viewed (0)
  4. .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:
    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)
  5. 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 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  6. clause/locking_test.go

    		},
    		{
    			[]clause.Interface{clause.Select{}, clause.From{}, clause.Locking{Strength: clause.LockingStrengthUpdate, Options: clause.LockingOptionsNoWait}},
    			"SELECT * FROM `users` FOR UPDATE NOWAIT", nil,
    		},
    		{
    			[]clause.Interface{clause.Select{}, clause.From{}, clause.Locking{Strength: clause.LockingStrengthUpdate, Options: clause.LockingOptionsSkipLocked}},
    			"SELECT * FROM `users` FOR UPDATE SKIP LOCKED", nil,
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:32:56 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  7. 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())
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 10 06:50:29 GMT 2023
    - 13.7K bytes
    - Viewed (0)
  8. tests/associations_many2many_test.go

    		wg.Add(1)
    		go func(user User, language Language) {
    			err := db.Model(&user).Association("Languages").Append(&language)
    			AssertEqual(t, err, nil)
    
    			wg.Done()
    		}(user, languages[i])
    	}
    	wg.Wait()
    
    	var find User
    	err = db.Preload(clause.Associations).Where("id = ?", user.ID).First(&find).Error
    	AssertEqual(t, err, nil)
    	AssertAssociationCount(t, find, "Languages", int64(count), "after concurrent append")
    }
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 13.2K bytes
    - Viewed (0)
Back to top