Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for Pauses (0.29 sec)

  1. callbacks.go

    			"row":    {db: db},
    			"raw":    {db: db},
    		},
    	}
    }
    
    // callbacks gorm callbacks manager
    type callbacks struct {
    	processors map[string]*processor
    }
    
    type processor struct {
    	db        *DB
    	Clauses   []string
    	fns       []func(*DB)
    	callbacks []*callback
    }
    
    type callback struct {
    	name      string
    	before    string
    	after     string
    	remove    bool
    	replace   bool
    	match     func(*DB) bool
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 8.6K bytes
    - Viewed (1)
  2. tests/create_test.go

    		Mobile: "on-conflict-user-mobile",
    	}
    	err = DB.Create(&u).Error
    	AssertEqual(t, err, nil)
    
    	u.Name = "on-conflict-user-name-2"
    	u.Email = "on-conflict-user-email-2"
    	u.Mobile = ""
    	err = DB.Clauses(clause.OnConflict{UpdateAll: true}).Create(&u).Error
    	AssertEqual(t, err, nil)
    
    	var u2 OnConflictUser
    	err = DB.Where("id = ?", u.ID).First(&u2).Error
    	AssertEqual(t, err, nil)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
  3. chainable_api.go

    	tx = db.getInstance()
    	tx.Statement.Model = value
    	return
    }
    
    // Clauses Add clauses
    //
    // This supports both standard clauses (clause.OrderBy, clause.Limit, clause.Where) and more
    // 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{})
    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)
  4. callbacks/create.go

    				for _, c := range db.Statement.Schema.CreateClauses {
    					db.Statement.AddClause(c)
    				}
    			}
    
    			if supportReturning && len(db.Statement.Schema.FieldsWithDefaultDBValue) > 0 {
    				if _, ok := db.Statement.Clauses["RETURNING"]; !ok {
    					fromColumns := make([]clause.Column, 0, len(db.Statement.Schema.FieldsWithDefaultDBValue))
    					for _, field := range db.Statement.Schema.FieldsWithDefaultDBValue {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 08 03:29:55 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  5. clause/where_test.go

    package clause_test
    
    import (
    	"fmt"
    	"testing"
    
    	"gorm.io/gorm/clause"
    )
    
    func TestWhere(t *testing.T) {
    	results := []struct {
    		Clauses []clause.Interface
    		Result  string
    		Vars    []interface{}
    	}{
    		{
    			[]clause.Interface{clause.Select{}, clause.From{}, clause.Where{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  6. callbacks/update.go

    			}
    		}
    
    		if db.Statement.SQL.Len() == 0 {
    			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...)
    		}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 05:44:55 GMT 2024
    - 9.4K bytes
    - Viewed (1)
  7. schema/field.go

    	// It causes field unnecessarily migration.
    	// Therefore, we need to record the UniqueIndex on this column (exclude Mul UniqueIndex) for MigrateColumnUnique.
    	UniqueIndex string
    }
    
    func (field *Field) BindName() string {
    	return strings.Join(field.BindNames, ".")
    }
    
    // ParseField parses reflect.StructField to Field
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  8. clause/where.go

    		if wrapInParentheses {
    			builder.WriteByte('(')
    			expr.Build(builder)
    			builder.WriteByte(')')
    			wrapInParentheses = false
    		} else {
    			expr.Build(builder)
    		}
    	}
    }
    
    // MergeClause merge where clauses
    func (where Where) MergeClause(clause *Clause) {
    	if w, ok := clause.Expression.(Where); ok {
    		exprs := make([]Expression, len(w.Exprs)+len(where.Exprs))
    		copy(exprs, w.Exprs)
    		copy(exprs[len(w.Exprs):], where.Exprs)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 5.1K bytes
    - Viewed (0)
  9. schema/relationship.go

    		settings = ParseTagSetting(str, ",")
    	)
    
    	// optimize match english letters and midline
    	// The following code is basically called in for.
    	// In order to avoid the performance problems caused by repeated compilation of regular expressions,
    	// it only needs to be done once outside, so optimization is done here.
    	if idx != -1 && regEnLetterAndMidline.MatchString(str[0:idx]) {
    		name = str[0:idx]
    	} else {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
  10. tests/query_test.go

    	if !regexp.MustCompile("SELECT \\* FROM .*users.* ORDER BY age desc,name").MatchString(result.Statement.SQL.String()) {
    		t.Fatalf("Build Order condition, but got %v", result.Statement.SQL.String())
    	}
    
    	stmt := dryDB.Clauses(clause.OrderBy{
    		Expression: clause.Expr{SQL: "FIELD(id,?)", Vars: []interface{}{[]int{1, 2, 3}}, WithoutParentheses: true},
    	}).Find(&User{}).Statement
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
Back to top