Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for prefix (0.16 sec)

  1. utils/utils.go

    		return strconv.FormatUint(v, 10)
    	}
    	return ""
    }
    
    const nestedRelationSplit = "__"
    
    // NestedRelationName nested relationships like `Manager__Company`
    func NestedRelationName(prefix, name string) string {
    	return prefix + nestedRelationSplit + name
    }
    
    // SplitNestedRelationName Split nested relationships to `[]string{"Manager","Company"}`
    func SplitNestedRelationName(name string) []string {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 22 06:43:02 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  2. schema/naming.go

    func (ns NamingStrategy) UniqueName(table, column string) string {
    	return ns.formatName("uni", table, ns.toDBName(column))
    }
    
    func (ns NamingStrategy) formatName(prefix, table, name string) string {
    	formattedName := strings.ReplaceAll(strings.Join([]string{
    		prefix, table, name,
    	}, "_"), ".", "_")
    
    	if ns.IdentifierMaxLength == 0 {
    		ns.IdentifierMaxLength = 64
    	}
    
    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)
  3. schema/naming_test.go

    	}
    }
    
    func TestFormatNameWithStringLongerThan63Characters(t *testing.T) {
    	ns := NamingStrategy{IdentifierMaxLength: 63}
    
    	formattedName := ns.formatName("prefix", "table", "thisIsAVeryVeryVeryVeryVeryVeryVeryVeryVeryLongString")
    	if formattedName != "prefix_table_thisIsAVeryVeryVeryVeryVeryVeryVeryVeryVer180f2c67" {
    		t.Errorf("invalid formatted name generated, got %v", formattedName)
    	}
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue May 30 02:00:48 GMT 2023
    - 7K bytes
    - Viewed (0)
  4. tests/embedded_struct_test.go

    		t.Fatalf("failed to auto migrate, got error: %v", err)
    	}
    
    	for _, name := range []string{"author_id", "author_name", "author_email"} {
    		if !DB.Migrator().HasColumn(&EngadgetPost{}, name) {
    			t.Errorf("should has prefixed column %v", name)
    		}
    	}
    
    	stmt := gorm.Statement{DB: DB}
    	if err := stmt.Parse(&EngadgetPost{}); err != nil {
    		t.Fatalf("failed to parse embedded struct")
    	} else if len(stmt.Schema.PrimaryFields) != 1 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Oct 26 03:58:13 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  5. tests/serializer_test.go

    	return "hello" + string(es), nil
    }
    
    type CustomSerializer struct {
    	prefix []byte
    }
    
    func NewCustomSerializer(prefix string) *CustomSerializer {
    	return &CustomSerializer{prefix: []byte(prefix)}
    }
    
    func (c *CustomSerializer) Scan(ctx context.Context, field *schema.Field, dst reflect.Value, dbValue interface{}) (err error) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 21 14:09:38 GMT 2023
    - 7.6K bytes
    - Viewed (0)
Back to top