Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for Kass (0.16 sec)

  1. tests/joins_test.go

    	DB.Create(&user)
    
    	query := DB.Model(&User{}).Joins("Company")
    	// Bug happens when .Count is called on a query.
    	// Removing the below two lines or downgrading to gorm v1.20.12 will make this test pass.
    	var total int64
    	query.Count(&total)
    
    	var result User
    
    	// Incorrectly generates a 'SELECT *' query which causes companies.id to overwrite users.id
    	if err := query.First(&result, user.ID).Error; err != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 26 14:19:32 GMT 2023
    - 13.5K bytes
    - Viewed (1)
  2. chainable_api.go

    //	db.Offset(5).Offset(-1).First(&user)
    func (db *DB) Offset(offset int) (tx *DB) {
    	tx = db.getInstance()
    	tx.Statement.AddClause(clause.Limit{Offset: offset})
    	return
    }
    
    // Scopes pass current database connection to arguments `func(DB) DB`, which could be used to add conditions dynamically
    //
    //	func AmountGreaterThan1000(db *gorm.DB) *gorm.DB {
    //	    return db.Where("amount > ?", 1000)
    //	}
    //
    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

    )
    
    // This regular expression seeks to find a sequence of digits (\d+) among zero or more non-digit characters (\D*),
    // with a possible trailing non-digit character (\D?).
    
    // 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)
    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. logger/sql_test.go

    		},
    		{
    			SQL:           "create table users (name, age, height, actived, bytes, create_at, update_at, deleted_at, email, role, pass) values (@p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11)",
    			NumericRegexp: regexp.MustCompile(`@p(\d+)`),
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  5. tests/scanner_valuer_test.go

    	nullTime := sql.NullTime{}
    	err := nullTime.Scan(v)
    	t.Time = nullTime.Time
    	return err
    }
    
    func (t EmptyTime) Value() (driver.Value, error) {
    	return time.Now() /* pass tests, mysql 8 doesn't support 0000-00-00 by default */, nil
    }
    
    type NullString struct {
    	sql.NullString
    }
    
    type Point struct {
    	X, Y int
    }
    
    func (point Point) GormDataType() string {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  6. tests/serializer_test.go

    	data := SerializerStruct{
    		Name:            []byte("jinzhu"),
    		Roles:           []string{"r1", "r2"},
    		Contracts:       map[string]interface{}{"name": "jinzhu", "age": 10},
    		EncryptedString: EncryptedString("pass"),
    		CreatedTime:     createdAt.Unix(),
    		UpdatedTime:     &updatedAt,
    		JobInfo: Job{
    			Title:    "programmer",
    			Number:   9920,
    			Location: "Kenmawr",
    			IsIntern: false,
    		},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 21 14:09:38 GMT 2023
    - 7.6K bytes
    - Viewed (0)
  7. gorm.go

    		} else {
    			// with clone statement
    			tx.Statement = db.Statement.clone()
    			tx.Statement.DB = tx
    		}
    
    		return tx
    	}
    
    	return db
    }
    
    // Expr returns clause.Expr, which can be used to pass SQL expression as params
    func Expr(expr string, args ...interface{}) clause.Expr {
    	return clause.Expr{SQL: expr, Vars: args}
    }
    
    // SetupJoinTable setup join table schema
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun Aug 20 11:46:56 GMT 2023
    - 11.6K bytes
    - Viewed (0)
Back to top