Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 26 for names (0.16 sec)

  1. schema/constraint.go

    		if chk := field.TagSettings["CHECK"]; chk != "" {
    			names := strings.Split(chk, ",")
    			if len(names) > 1 && regEnLetterAndMidline.MatchString(names[0]) {
    				checks[names[0]] = CheckConstraint{Name: names[0], Constraint: strings.Join(names[1:], ","), Field: field}
    			} else {
    				if names[0] == "" {
    					chk = strings.Join(names[1:], ",")
    				}
    				name := schema.namer.CheckerName(schema.Table, field.DBName)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 07:33:54 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  2. callbacks.go

    		return false
    	})
    
    	for _, c := range cs {
    		// show warning message the callback name already exists
    		if idx := getRIndex(names, c.name); idx > -1 && !c.replace && !c.remove && !cs[idx].remove {
    			c.processor.db.Logger.Warn(context.Background(), "duplicated callback `%s` from %s\n", c.name, utils.FileWithLineNum())
    		}
    		names = append(names, c.name)
    	}
    
    	sortCallback = func(c *callback) error {
    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)
  3. scan.go

    						}
    					} else if names := utils.SplitNestedRelationName(column); len(names) > 1 { // has nested relation
    						if rel, ok := sch.Relationships.Relations[names[0]]; ok {
    							subNameCount := len(names)
    							// nested relation fields
    							relFields := make([]*schema.Field, 0, subNameCount-1)
    							relFields = append(relFields, rel.Field)
    							for _, name := range names[1 : subNameCount-1] {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 09:53:11 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  4. tests/scopes_test.go

    )
    
    func NameIn1And2(d *gorm.DB) *gorm.DB {
    	return d.Where("name in (?)", []string{"ScopeUser1", "ScopeUser2"})
    }
    
    func NameIn2And3(d *gorm.DB) *gorm.DB {
    	return d.Where("name in (?)", []string{"ScopeUser2", "ScopeUser3"})
    }
    
    func NameIn(names []string) func(d *gorm.DB) *gorm.DB {
    	return func(d *gorm.DB) *gorm.DB {
    		return d.Where("name in (?)", names)
    	}
    }
    
    func TestScopes(t *testing.T) {
    	users := []*User{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  5. chainable_api.go

    	return
    }
    
    // Group specify the group method on the find
    //
    //	// Select the sum age of users with given names
    //	db.Model(&User{}).Select("name, sum(age) as total").Group("name").Find(&results)
    func (db *DB) Group(name string) (tx *DB) {
    	tx = db.getInstance()
    
    	fields := strings.FieldsFunc(name, utils.IsValidDBNameChar)
    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)
  6. schema/utils.go

    	settings := map[string]string{}
    	names := strings.Split(str, sep)
    
    	for i := 0; i < len(names); i++ {
    		j := i
    		if len(names[j]) > 0 {
    			for {
    				if names[j][len(names[j])-1] == '\\' {
    					i++
    					names[j] = names[j][0:len(names[j])-1] + sep + names[i]
    					names[i] = ""
    				} else {
    					break
    				}
    			}
    		}
    
    		values := strings.Split(names[j], ":")
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Aug 19 13:35:14 GMT 2023
    - 5.5K bytes
    - Viewed (0)
  7. tests/migrate_test.go

    	checkField(&UniqueStruct5{}, "name", false, "idx_unique_struct5_name")
    	checkField(&UniqueStruct6{}, "name", false, "idx_unique_struct6_name")
    
    	checkField(&UniqueStruct7{}, "name", false, "")
    	checkField(&UniqueStruct7{}, "nick_name", false, "")
    	checkField(&UniqueStruct7{}, "nick_name", false, "")
    
    	type UniqueStruct8 struct { // unique and uniqueIndex
    		Name string `gorm:"size:60;unique;index:my_us8_index,unique;"`
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  8. tests/callbacks_test.go

    	if !ok {
    		reflectValue = reflect.ValueOf(fc)
    	}
    
    	fnames := strings.Split(runtime.FuncForPC(reflectValue.Pointer()).Name(), ".")
    	return fnames[len(fnames)-1]
    }
    
    func c1(*gorm.DB) {}
    func c2(*gorm.DB) {}
    func c3(*gorm.DB) {}
    func c4(*gorm.DB) {}
    func c5(*gorm.DB) {}
    func c6(*gorm.DB) {}
    
    func TestCallbacks(t *testing.T) {
    	type callback struct {
    		name    string
    		before  string
    		after   string
    		remove  bool
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  9. schema/naming.go

    }
    
    func (ns NamingStrategy) toDBName(name string) string {
    	if name == "" {
    		return ""
    	}
    
    	if ns.NameReplacer != nil {
    		tmpName := ns.NameReplacer.Replace(name)
    
    		if tmpName == "" {
    			return name
    		}
    
    		name = tmpName
    	}
    
    	if ns.NoLowerCase {
    		return name
    	}
    
    	var (
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 5.2K bytes
    - Viewed (0)
  10. utils/tests/models.go

    }
    
    type Pet struct {
    	gorm.Model
    	UserID *uint
    	Name   string
    	Toy    Toy `gorm:"polymorphic:Owner;"`
    }
    
    type Toy struct {
    	gorm.Model
    	Name      string
    	OwnerID   string
    	OwnerType string
    }
    
    type Tools struct {
    	gorm.Model
    	Name     string
    	CustomID string
    	Type     string
    }
    
    type Company struct {
    	ID   int
    	Name string
    }
    
    type Language struct {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 2.1K bytes
    - Viewed (0)
Back to top