Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 44 for expression (0.16 sec)

  1. finisher_api.go

    		queryDB      = tx
    		rowsAffected int64
    		batch        int
    	)
    
    	// user specified offset or limit
    	var totalSize int
    	if c, ok := tx.Statement.Clauses["LIMIT"]; ok {
    		if limit, ok := c.Expression.(clause.Limit); ok {
    			if limit.Limit != nil {
    				totalSize = *limit.Limit
    			}
    
    			if totalSize > 0 && batchSize > totalSize {
    				batchSize = totalSize
    			}
    
    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)
  2. clause/where_test.go

    				Exprs: []clause.Expression{clause.Or(clause.Neq{Column: "name", Value: "jinzhu"}), clause.Eq{Column: clause.PrimaryColumn, Value: "1"}, clause.Gt{Column: "age", Value: 18}},
    			}},
    			"SELECT * FROM `users` WHERE `users`.`id` = ? OR `name` <> ? AND `age` > ?",
    			[]interface{}{"1", "jinzhu", 18},
    		},
    		{
    			[]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)
  3. clause/group_by_test.go

    				Columns: []clause.Column{{Name: "role"}},
    				Having:  []clause.Expression{clause.Eq{"role", "admin"}},
    			}},
    			"SELECT * FROM `users` GROUP BY `role` HAVING `role` = ?",
    			[]interface{}{"admin"},
    		},
    		{
    			[]clause.Interface{clause.Select{}, clause.From{}, clause.GroupBy{
    				Columns: []clause.Column{{Name: "role"}},
    				Having:  []clause.Expression{clause.Eq{"role", "admin"}},
    			}, clause.GroupBy{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 1.1K bytes
    - Viewed (0)
  4. clause/from_test.go

    							ON: clause.Where{
    								[]clause.Expression{clause.Eq{clause.Column{Table: "profiles", Name: "email"}, clause.Column{Table: clause.CurrentTable, Name: "email"}}},
    							},
    						},
    					},
    				}, clause.From{
    					Joins: []clause.Join{
    						{
    							Type:  clause.InnerJoin,
    							Table: clause.Table{Name: "articles"},
    							ON: clause.Where{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Jul 15 02:25:10 GMT 2020
    - 1.9K bytes
    - Viewed (0)
  5. callbacks/create.go

    		if !isDryRun {
    			return
    		}
    
    		ok, mode := hasReturning(db, supportReturning)
    		if ok {
    			if c, ok := db.Statement.Clauses["ON CONFLICT"]; ok {
    				if onConflict, _ := c.Expression.(clause.OnConflict); onConflict.DoNothing {
    					mode |= gorm.ScanOnConflictDoNothing
    				}
    			}
    
    			rows, err := db.Statement.ConnPool.QueryContext(
    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)
  6. schema/index.go

    					Type:    settings["TYPE"],
    					Where:   settings["WHERE"],
    					Comment: settings["COMMENT"],
    					Option:  settings["OPTION"],
    					Fields: []IndexOption{{
    						Field:      field,
    						Expression: settings["EXPRESSION"],
    						Sort:       settings["SORT"],
    						Collate:    settings["COLLATE"],
    						Length:     length,
    						priority:   priority,
    					}},
    				})
    			}
    		}
    	}
    
    	err = nil
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  7. schema/index_test.go

    	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"`
    	OID          int64  `gorm:"index:idx_id;index:idx_oid,unique"`
    	MemberNumber string `gorm:"index:idx_id,priority:1"`
    	Name7        string `gorm:"index:type"`
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 8K bytes
    - Viewed (0)
  8. statement.go

    				// looks like a where condition
    				return []clause.Expression{clause.Expr{SQL: s, Vars: args}}
    			}
    
    			if len(args) > 0 && strings.Contains(s, "@") {
    				// looks like a named query
    				return []clause.Expression{clause.NamedExpr{SQL: s, Vars: args}}
    			}
    
    			if strings.Contains(strings.TrimSpace(s), " ") {
    				// looks like a where condition
    				return []clause.Expression{clause.Expr{SQL: s, Vars: args}}
    			}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
  9. callbacks/helper.go

    		}
    	}
    	return
    }
    
    func hasReturning(tx *gorm.DB, supportReturning bool) (bool, gorm.ScanMode) {
    	if supportReturning {
    		if c, ok := tx.Statement.Clauses["RETURNING"]; ok {
    			returning, _ := c.Expression.(clause.Returning)
    			if len(returning.Columns) == 0 || (len(returning.Columns) == 1 && returning.Columns[0].Name == "*") {
    				return true, 0
    			}
    			return true, gorm.ScanUpdate
    		}
    	}
    	return false, 0
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 14 12:32:57 GMT 2022
    - 3.7K bytes
    - Viewed (0)
  10. callbacks/update.go

    					stmt.AddClause(clause.Where{Exprs: []clause.Expression{clause.IN{Column: column, Values: values}}})
    				}
    			}
    		case reflect.Struct:
    			for _, field := range stmt.Schema.PrimaryFields {
    				if value, isZero := field.ValueOf(stmt.Context, stmt.ReflectValue); !isZero {
    					stmt.AddClause(clause.Where{Exprs: []clause.Expression{clause.Eq{Column: field.DBName, Value: value}}})
    				}
    			}
    		}
    	}
    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)
Back to top