Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for Queries (0.25 sec)

  1. tests/connpool_test.go

    }
    
    // If you use BeginTx returned *sql.Tx as shown below then you can't record queries in a transaction.
    //
    //	func (c *wrapperConnPool) BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error) {
    //		 return c.db.BeginTx(ctx, opts)
    //	}
    //
    // You should use BeginTx returned gorm.Tx which could wrap *sql.Tx then you can record all queries.
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Feb 06 02:54:40 GMT 2024
    - 5.5K bytes
    - Viewed (0)
  2. chainable_api.go

    		tx.Statement.AddClause(clause.Where{Exprs: []clause.Expression{clause.Not(conds...)}})
    	}
    	return
    }
    
    // Or add OR conditions
    //
    // Or is used to chain together queries with an OR.
    //
    //	// Find the first user with name equal to jinzhu or john
    //	db.Where("name = ?", "jinzhu").Or("name = ?", "john").First(&user)
    func (db *DB) Or(query interface{}, args ...interface{}) (tx *DB) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  3. migrator/migrator.go

    // For example, values that can pass this regular expression are:
    // - "123"
    // - "abc456"
    // -"%$#@789"
    var regFullDataType = regexp.MustCompile(`\D*(\d+)\D?`)
    
    // TODO:? Create const vars for raw sql queries ?
    
    var _ gorm.Migrator = (*Migrator)(nil)
    
    // Migrator m struct
    type Migrator struct {
    	Config
    }
    
    // Config schema config
    type Config struct {
    	CreateIndexAfterCreateTable bool
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  4. finisher_api.go

    	}
    
    	currentLogger.Trace(tx.Statement.Context, newLogger.BeginAt, func() (string, int64) {
    		return newLogger.SQL, tx.RowsAffected
    	}, tx.Error)
    	tx.Logger = currentLogger
    	return
    }
    
    // Pluck queries a single column from a model, returning in the slice dest. E.g.:
    //
    //	var ages []int64
    //	db.Model(&users).Pluck("age", &ages)
    func (db *DB) Pluck(column string, dest interface{}) (tx *DB) {
    	tx = db.getInstance()
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
  5. tests/preload_test.go

    	if err != nil {
    		t.Errorf("failed to find value, got err: %v", err)
    	}
    	AssertEqual(t, find1, value1)
    
    	var find2 Value
    	// Joins will automatically add Nested queries.
    	err = DB.Joins("Nested.Join").Preload("Nested.Preloads").First(&find2, value2.ID).Error
    	if err != nil {
    		t.Errorf("failed to find value, got err: %v", err)
    	}
    	AssertEqual(t, find2, value2)
    
    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. tests/update_test.go

    	}
    
    	// Verify that Age now=`newAge`.
    	result := &User{}
    	result.ID = user.ID
    	DB.Preload("Account").First(result)
    
    	if result.Age != newAge {
    		t.Errorf("Expected freshly queried user to have Age=%v but instead found Age=%v", newAge, result.Age)
    	}
    
    	if result.Account.Number != user.Account.Number {
    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)
Back to top