Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 39 for Fprintf (0.18 sec)

  1. clause/group_by_test.go

    			}},
    			"SELECT * FROM `users` GROUP BY `role`,`gender` HAVING `role` = ? AND `gender` <> ?",
    			[]interface{}{"admin", "U"},
    		},
    	}
    
    	for idx, result := range results {
    		t.Run(fmt.Sprintf("case #%v", idx), func(t *testing.T) {
    			checkBuildClauses(t, result.Clauses, result.Result, result.Vars)
    		})
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 1.1K bytes
    - Viewed (0)
  2. clause/from_test.go

    					},
    				},
    			},
    			"SELECT * FROM `users` INNER JOIN `articles` ON `articles`.`id` = `users`.`id` LEFT JOIN `companies` USING (`company_name`)", nil,
    		},
    	}
    
    	for idx, result := range results {
    		t.Run(fmt.Sprintf("case #%v", idx), func(t *testing.T) {
    			checkBuildClauses(t, result.Clauses, result.Result, result.Vars)
    		})
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Jul 15 02:25:10 GMT 2020
    - 1.9K bytes
    - Viewed (0)
  3. schema/utils.go

    	}
    	return tag
    }
    
    func appendSettingFromTag(tag reflect.StructTag, value string) reflect.StructTag {
    	t := tag.Get("gorm")
    	if strings.Contains(t, value) {
    		return tag
    	}
    	return reflect.StructTag(fmt.Sprintf(`gorm:"%s;%s"`, value, t))
    }
    
    // GetRelationsValues get relations's values from a reflect value
    func GetRelationsValues(ctx context.Context, reflectValue reflect.Value, rels []*Relationship) (reflectResults reflect.Value) {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Aug 19 13:35:14 GMT 2023
    - 5.5K bytes
    - Viewed (0)
  4. clause/where_test.go

    					}),
    				}}},
    			"SELECT * FROM `users` WHERE NOT ((`users`.`id` = ? AND `age` > ?) OR `score` < ?)",
    			[]interface{}{"1", 18, 100},
    		},
    	}
    
    	for idx, result := range results {
    		t.Run(fmt.Sprintf("case #%v", idx), func(t *testing.T) {
    			checkBuildClauses(t, result.Clauses, result.Result, result.Vars)
    		})
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  5. tests/scanner_valuer_test.go

    func (point Point) GormDataType() string {
    	return "geo"
    }
    
    func (point Point) GormValue(ctx context.Context, db *gorm.DB) clause.Expr {
    	return clause.Expr{
    		SQL:  "ST_PointFromText(?)",
    		Vars: []interface{}{fmt.Sprintf("POINT(%d %d)", point.X, point.Y)},
    	}
    }
    
    func TestGORMValuer(t *testing.T) {
    	type UserWithPoint struct {
    		Name  string
    		Point Point
    	}
    
    	dryRunDB := DB.Session(&gorm.Session{DryRun: true})
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  6. logger/sql.go

    				vars[idx] = fmt.Sprintf("%d", reflectValue.Interface())
    			case reflect.Float32, reflect.Float64:
    				vars[idx] = fmt.Sprintf("%.6f", reflectValue.Interface())
    			case reflect.Bool:
    				vars[idx] = fmt.Sprintf("%t", reflectValue.Interface())
    			case reflect.String:
    				vars[idx] = escaper + strings.ReplaceAll(fmt.Sprintf("%v", v), escaper, escaper+escaper) + escaper
    			default:
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 5K bytes
    - Viewed (0)
  7. tests/callbacks_test.go

    	var (
    		got   []string
    		funcs = reflect.ValueOf(v).Elem().FieldByName("fns")
    	)
    
    	for i := 0; i < funcs.Len(); i++ {
    		got = append(got, getFuncName(funcs.Index(i)))
    	}
    
    	return fmt.Sprint(got) == fmt.Sprint(fnames), fmt.Sprintf("expects %v, got %v", fnames, got)
    }
    
    func getFuncName(fc interface{}) string {
    	reflectValue, ok := fc.(reflect.Value)
    	if !ok {
    		reflectValue = reflect.ValueOf(fc)
    	}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  8. migrator/migrator.go

    				if !field.PrimaryKey &&
    					(len(matches2) == 1 && matches2[0][1] != fmt.Sprint(length) && ok) {
    					alterColumn = true
    				}
    			}
    		}
    
    		// check precision
    		if precision, _, ok := columnType.DecimalSize(); ok && int64(field.Precision) != precision {
    			if regexp.MustCompile(fmt.Sprintf("[^0-9]%d[^0-9]", field.Precision)).MatchString(m.DataTypeOf(field)) {
    				alterColumn = true
    			}
    		}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  9. clause/select_test.go

    								},
    							},
    						},
    					},
    				},
    			}, clause.From{}},
    			"SELECT `age` = ? as name FROM `users`",
    			[]interface{}{18},
    		},
    	}
    
    	for idx, result := range results {
    		t.Run(fmt.Sprintf("case #%v", idx), func(t *testing.T) {
    			checkBuildClauses(t, result.Clauses, result.Result, result.Vars)
    		})
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Feb 18 01:06:43 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  10. schema/schema_helper_test.go

    						var primaryKey, primaryKeySchema string
    						if rf.PrimaryKey != nil {
    							primaryKey, primaryKeySchema = rf.PrimaryKey.Name, rf.PrimaryKey.Schema.Name
    						}
    						refs = append(refs, fmt.Sprintf(
    							"{PrimaryKey: %v PrimaryKeySchame: %v ForeignKey: %v ForeignKeySchema: %v PrimaryValue: %v OwnPrimaryKey: %v}",
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 7.5K bytes
    - Viewed (0)
Back to top