Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for mock (0.19 sec)

  1. 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()
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 28 08:47:39 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  2. chainable_api.go

    // advanced techniques like specifying lock strength and optimizer hints. See the
    // [docs] for more depth.
    //
    //	// add a simple limit clause
    //	db.Clauses(clause.Limit{Limit: 1}).Find(&User{})
    //	// tell the optimizer to use the `idx_user_name` index
    //	db.Clauses(hints.UseIndex("idx_user_name")).Find(&User{})
    //	// specify the lock strength to UPDATE
    //	db.Clauses(clause.Locking{Strength: "UPDATE"}).Find(&users)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  3. statement.go

    	changed := func(field *schema.Field) bool {
    		fieldValue, _ := field.ValueOf(stmt.Context, modelValue)
    		if v, ok := selectColumns[field.DBName]; (ok && v) || (!ok && !restricted) {
    			if mv, mok := stmt.Dest.(map[string]interface{}); mok {
    				if fv, ok := mv[field.Name]; ok {
    					return !utils.AssertEqual(fv, fieldValue)
    				} else if fv, ok := mv[field.DBName]; ok {
    					return !utils.AssertEqual(fv, fieldValue)
    				}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
  4. tests/migrate_test.go

    			Migrator: m,
    		}
    	}
    	m := DB.Migrator()
    	mockM := wrapMockMigrator(m)
    
    	type NotTriggerUpdate struct {
    		ID  uint
    		F1  uint16
    		F2  uint32
    		F3  int
    		F4  int64
    		F5  string
    		F6  float32
    		F7  float64
    		F8  time.Time
    		F9  bool
    		F10 []byte
    	}
    
    	var err error
    	err = mockM.DropTable(&NotTriggerUpdate{})
    	AssertEqual(t, err, nil)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  5. tests/sql_builder_test.go

    	// replace SQL quote, convert into postgresql like ""
    	expected = replaceQuoteInSQL(expected)
    	actually = replaceQuoteInSQL(actually)
    
    	// ignore updated_at value, because it's generated in Gorm internal, can't to mock value on update.
    	updatedAtRe := regexp.MustCompile(`(?i)"updated_at"=".+?"`)
    	actually = updatedAtRe.ReplaceAllString(actually, `"updated_at"=?`)
    	expected = updatedAtRe.ReplaceAllString(expected, `"updated_at"=?`)
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
  6. tests/prepared_stmt_test.go

    	if !ok {
    		t.Fatalf("should assign PreparedStatement Manager back to database when using PrepareStmt mode")
    	}
    
    	pdb.Mux.Lock()
    	if len(pdb.Stmts) == 0 {
    		pdb.Mux.Unlock()
    		t.Fatalf("prepared stmt can not be empty")
    	}
    	pdb.Mux.Unlock()
    
    	pdb.Reset()
    	pdb.Mux.Lock()
    	defer pdb.Mux.Unlock()
    	if len(pdb.Stmts) != 0 {
    		t.Fatalf("prepared stmt should be empty")
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 21 07:55:43 GMT 2024
    - 4K bytes
    - Viewed (0)
Back to top