Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for SplitN (0.2 sec)

  1. utils/utils.go

    func NestedRelationName(prefix, name string) string {
    	return prefix + nestedRelationSplit + name
    }
    
    // SplitNestedRelationName Split nested relationships to `[]string{"Manager","Company"}`
    func SplitNestedRelationName(name string) []string {
    	return strings.Split(name, nestedRelationSplit)
    }
    
    // JoinNestedRelationNames nested relationships like `Manager__Company`
    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/preload.go

    		for _, join := range joins {
    			if _, ok := relationships.Relations[join]; ok && name == join {
    				joined = true
    				continue
    			}
    			joinNames := strings.SplitN(join, ".", 2)
    			if len(joinNames) == 2 {
    				if _, ok := relationships.Relations[joinNames[0]]; ok && name == joinNames[0] {
    					joined = true
    					nestedJoins = append(nestedJoins, joinNames[1])
    				}
    			}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  3. callbacks/query.go

    					if ok {
    						isRelations = true
    						relations = append(relations, relation)
    					} else {
    						// handle nested join like "Manager.Company"
    						nestedJoinNames := strings.Split(join.Name, ".")
    						if len(nestedJoinNames) > 1 {
    							isNestedJoin := true
    							gussNestedRelations := make([]*schema.Relationship, 0, len(nestedJoinNames))
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Jan 29 03:34:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  4. tests/callbacks_test.go

    }
    
    func getFuncName(fc interface{}) string {
    	reflectValue, ok := fc.(reflect.Value)
    	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) {}
    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)
  5. chainable_api.go

    			if results[1] != "" {
    				tx.Statement.Table = results[1]
    			} else {
    				tx.Statement.Table = results[2]
    			}
    		}
    	} else if tables := strings.Split(name, "."); len(tables) == 2 {
    		tx.Statement.TableExpr = &clause.Expr{SQL: tx.Statement.Quote(name)}
    		tx.Statement.Table = tables[1]
    	} else if name != "" {
    		tx.Statement.TableExpr = &clause.Expr{SQL: tx.Statement.Quote(name)}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  6. schema/index.go

    	for _, value := range strings.Split(field.Tag.Get("gorm"), ";") {
    		if value != "" {
    			v := strings.Split(value, ":")
    			k := strings.TrimSpace(strings.ToUpper(v[0]))
    			if k == "INDEX" || k == "UNIQUEINDEX" {
    				var (
    					name       string
    					tag        = strings.Join(v[1:], ":")
    					idx        = strings.Index(tag, ",")
    					tagSetting = strings.Join(strings.Split(tag, ",")[1:], ",")
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  7. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Aug 19 13:35:14 GMT 2023
    - 5.5K bytes
    - Viewed (0)
  8. schema/schema_test.go

    func (ns CustomizedNamingStrategy) ColumnName(table, column string) string {
    	baseColumnName := ns.NamingStrategy.ColumnName(table, column)
    
    	if table == "" {
    		return baseColumnName
    	}
    
    	s := strings.Split(table, "_")
    
    	var prefix string
    	switch len(s) {
    	case 1:
    		prefix = s[0][:3]
    	case 2:
    		prefix = s[0][:1] + s[1][:2]
    	default:
    		prefix = s[0][:1] + s[1][:1] + s[2][:1]
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  9. statement.go

    	if stmt.Schema, err = schema.ParseWithSpecialTableName(value, stmt.DB.cacheStore, stmt.DB.NamingStrategy, specialTableName); err == nil && stmt.Table == "" {
    		if tables := strings.Split(stmt.Schema.Table, "."); len(tables) == 2 {
    			stmt.TableExpr = &clause.Expr{SQL: stmt.Quote(stmt.Schema.Table)}
    			stmt.Table = tables[1]
    			return
    		}
    
    		stmt.Table = stmt.Schema.Table
    	}
    	return err
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
  10. schema/constraint.go

    func (schema *Schema) ParseCheckConstraints() map[string]CheckConstraint {
    	checks := map[string]CheckConstraint{}
    	for _, field := range schema.FieldsByDBName {
    		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] == "" {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 07:33:54 GMT 2024
    - 1.9K bytes
    - Viewed (0)
Back to top