Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 31 for 10 (0.13 sec)

  1. utils/utils.go

    	case int:
    		return strconv.FormatInt(int64(v), 10)
    	case int8:
    		return strconv.FormatInt(int64(v), 10)
    	case int16:
    		return strconv.FormatInt(int64(v), 10)
    	case int32:
    		return strconv.FormatInt(int64(v), 10)
    	case int64:
    		return strconv.FormatInt(v, 10)
    	case uint:
    		return strconv.FormatUint(uint64(v), 10)
    	case uint8:
    		return strconv.FormatUint(uint64(v), 10)
    	case uint16:
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 22 06:43:02 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  2. callbacks/associations.go

    				if !isPtr {
    					fieldType = reflect.PtrTo(fieldType)
    				}
    				elems := reflect.MakeSlice(reflect.SliceOf(fieldType), 0, 10)
    				distinctElems := reflect.MakeSlice(reflect.SliceOf(fieldType), 0, 10)
    				joins := reflect.MakeSlice(reflect.SliceOf(reflect.PtrTo(rel.JoinTable.ModelType)), 0, 10)
    				objs := []reflect.Value{}
    
    				appendToJoins := func(obj reflect.Value, elem reflect.Value) {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Apr 11 03:06:13 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  3. clause/benchmarks_test.go

    		}
    
    		stmt.Build("SELECT", "FROM", "WHERE")
    		_ = stmt.SQL.String()
    	}
    }
    
    func BenchmarkComplexSelect(b *testing.B) {
    	user, _ := schema.Parse(&tests.User{}, &sync.Map{}, db.NamingStrategy)
    
    	limit10 := 10
    	for i := 0; i < b.N; i++ {
    		stmt := gorm.Statement{DB: db, Table: user.Table, Schema: user, Clauses: map[string]clause.Clause{}}
    		clauses := []clause.Interface{
    			clause.Select{},
    			clause.From{},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Oct 07 12:14:14 GMT 2022
    - 1.9K bytes
    - Viewed (0)
  4. tests/hooks_test.go

    	tx.Statement.SetColumn("Price", s.Price+100)
    	return nil
    }
    
    func (s Product3) BeforeUpdate(tx *gorm.DB) (err error) {
    	if tx.Statement.Changed() {
    		tx.Statement.SetColumn("Price", s.Price+10)
    	}
    
    	if tx.Statement.Changed("Code") {
    		s.Price += 20
    		tx.Statement.SetColumn("Price", s.Price+30)
    	}
    	return nil
    }
    
    func TestSetColumn(t *testing.T) {
    	DB.Migrator().DropTable(&Product3{})
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 15.9K bytes
    - Viewed (0)
  5. clause/expression.go

    								appendFieldsToMap(reflectValue.Field(i))
    							}
    						}
    					}
    				}
    			}
    
    			appendFieldsToMap(reflect.ValueOf(value))
    		}
    	}
    
    	name := make([]byte, 0, 10)
    
    	for _, v := range []byte(expr.SQL) {
    		if v == '@' && !inName {
    			inName = true
    			name = name[:0]
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Oct 10 06:45:48 GMT 2023
    - 8.3K bytes
    - Viewed (0)
  6. logger/sql_test.go

    		},
    		{
    			SQL:           "create table users (name, age, height, actived, bytes, create_at, update_at, deleted_at, email, role, pass) values ($3, $4, $1, $2, $7, $8, $5, $6, $9, $10, $11)",
    			NumericRegexp: regexp.MustCompile(`\$(\d+)`),
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  7. clause/limit_test.go

    package clause_test
    
    import (
    	"fmt"
    	"testing"
    
    	"gorm.io/gorm/clause"
    )
    
    func TestLimit(t *testing.T) {
    	limit0 := 0
    	limit10 := 10
    	limit50 := 50
    	limitNeg10 := -10
    	results := []struct {
    		Clauses []clause.Interface
    		Result  string
    		Vars    []interface{}
    	}{
    		{
    			[]clause.Interface{clause.Select{}, clause.From{}, clause.Limit{
    				Limit:  &limit10,
    				Offset: 20,
    			}},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Feb 06 02:54:40 GMT 2024
    - 2.3K bytes
    - Viewed (0)
  8. .github/workflows/tests.yml

              - 9910:3306
            options: >-
              --health-cmd "mysqladmin ping -ugorm -pgorm"
              --health-interval 10s
              --health-start-period 10s
              --health-timeout 5s
              --health-retries 10
    
        steps:
        - name: Set up Go 1.x
          uses: actions/setup-go@v4
          with:
            go-version: ${{ matrix.go }}
    
        - name: Check out code into the Go module directory
          uses: actions/checkout@v4
    Others
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Jan 29 02:34:20 GMT 2024
    - 6.6K bytes
    - Viewed (0)
  9. schema/index_test.go

    	Name3        string `gorm:"index:,sort:desc,collate:utf8,type:btree,length:10,where:name3 != 'jinzhu'"`
    	Name4        string `gorm:"uniqueIndex"`
    	Name5        int64  `gorm:"index:,class:FULLTEXT,comment:hello \\, world,where:age > 10"`
    	Name6        int64  `gorm:"index:profile,comment:hello \\, world,where:age > 10"`
    	Age          int64  `gorm:"index:profile,expression:ABS(age),option:WITH PARSER parser_name"`
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 8K bytes
    - Viewed (0)
  10. tests/gorm_test.go

    			t.Fatalf("rows affected expects: %v, got %v", 1, results.RowsAffected)
    		}
    
    		u1 = user{} // important to reinitialize this before creating it again
    		u2 := user{}
    		db := DB.Session(&gorm.Session{CreateBatchSize: 10})
    
    		if results := db.Create([]*user{&u1, &u2}); results.Error != nil {
    			t.Fatalf("errors happened on create: %v", results.Error)
    		} else if results.RowsAffected != 2 {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Jun 01 07:22:21 GMT 2023
    - 3.3K bytes
    - Viewed (0)
Back to top