Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for derer (0.02 sec)

  1. callbacks/query.go

    		if !db.DryRun && db.Error == nil {
    			rows, err := db.Statement.ConnPool.QueryContext(db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...)
    			if err != nil {
    				db.AddError(err)
    				return
    			}
    			defer func() {
    				db.AddError(rows.Close())
    			}()
    			gorm.Scan(rows, db, 0)
    		}
    	}
    }
    
    func BuildQuerySQL(db *gorm.DB) {
    	if db.Statement.Schema != nil {
    		for _, c := range db.Statement.Schema.QueryClauses {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 09:51:44 UTC 2024
    - 10.1K bytes
    - Viewed (0)
  2. migrator/migrator.go

    				}
    
    				values = append(values, primaryKeys)
    			}
    
    			for _, idx := range stmt.Schema.ParseIndexes() {
    				if m.CreateIndexAfterCreateTable {
    					defer func(value interface{}, name string) {
    						if err == nil {
    							err = tx.Migrator().CreateIndex(value, name)
    						}
    					}(value, idx.Name)
    				} else {
    					if idx.Class != "" {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Fri Apr 26 07:15:49 UTC 2024
    - 29K bytes
    - Viewed (0)
  3. callbacks/create.go

    				}
    			}
    
    			rows, err := db.Statement.ConnPool.QueryContext(
    				db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...,
    			)
    			if db.AddError(err) == nil {
    				defer func() {
    					db.AddError(rows.Close())
    				}()
    				gorm.Scan(rows, db, mode)
    			}
    
    			return
    		}
    
    		result, err := db.Statement.ConnPool.ExecContext(
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Apr 08 03:29:55 UTC 2024
    - 12.5K bytes
    - Viewed (0)
  4. tests/prepared_stmt_test.go

    		t.Fatalf("should assign PreparedStatement Manager back to database when using PrepareStmt mode")
    	}
    
    	ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond)
    	defer cancel()
    	txCtx := tx.WithContext(ctx)
    
    	user := *GetUser("prepared_stmt", Config{})
    
    	txCtx.Create(&user)
    
    	var result1 User
    	if err := txCtx.Find(&result1, user.ID).Error; err != nil {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Mar 21 07:55:43 UTC 2024
    - 4K bytes
    - Viewed (0)
  5. callbacks/update.go

    			db.Statement.SQL.Grow(180)
    			db.Statement.AddClauseIfNotExists(clause.Update{})
    			if _, ok := db.Statement.Clauses["SET"]; !ok {
    				if set := ConvertToAssignments(db.Statement); len(set) != 0 {
    					defer delete(db.Statement.Clauses, "SET")
    					db.Statement.AddClause(set)
    				} else {
    					return
    				}
    			}
    
    			db.Statement.Build(db.Statement.BuildClauses...)
    		}
    
    		checkMissingWhereConditions(db)
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Mar 18 05:44:55 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  6. tests/preload_test.go

    		t.Errorf("json marshal is not empty slice, got %v", string(r))
    	}
    }
    
    func TestPreloadGoroutine(t *testing.T) {
    	var wg sync.WaitGroup
    
    	wg.Add(10)
    	for i := 0; i < 10; i++ {
    		go func() {
    			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()
    }
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:00:47 UTC 2024
    - 15.9K bytes
    - Viewed (0)
  7. prepare_stmt.go

    	}
    
    	return nil, ErrInvalidDB
    }
    
    func (db *PreparedStmtDB) Close() {
    	db.Mux.Lock()
    	defer db.Mux.Unlock()
    
    	for _, query := range db.PreparedSQL {
    		if stmt, ok := db.Stmts[query]; ok {
    			delete(db.Stmts, query)
    			go stmt.Close()
    		}
    	}
    }
    
    func (sdb *PreparedStmtDB) Reset() {
    	sdb.Mux.Lock()
    	defer sdb.Mux.Unlock()
    
    	for _, stmt := range sdb.Stmts {
    		go stmt.Close()
    	}
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Mar 28 08:47:39 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  8. schema/schema.go

    		cacheStore:       cacheStore,
    		namer:            namer,
    		initialized:      make(chan struct{}),
    	}
    	// When the schema initialization is completed, the channel will be closed
    	defer close(schema.initialized)
    
    	// 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
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:52:33 UTC 2024
    - 13.7K bytes
    - Viewed (0)
  9. tests/transaction_test.go

    		return nil
    	})
    
    	if err == nil {
    		t.Fatalf("Transaction should get error when using cancelled context")
    	}
    }
    
    func TestTransactionWithBlock(t *testing.T) {
    	assertPanic := func(f func()) {
    		defer func() {
    			if r := recover(); r == nil {
    				t.Fatalf("The code did not panic")
    			}
    		}()
    		f()
    	}
    
    	// rollback
    	err := DB.Transaction(func(tx *gorm.DB) error {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed May 08 04:07:58 UTC 2024
    - 10.9K bytes
    - Viewed (0)
Back to top