Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for ParseTagSetting (0.05 sec)

  1. schema/utils_test.go

    	}
    }
    
    func TestParseTagSettingWithDoubleQuoteEscape(t *testing.T) {
    	tag := `gorm:"expression:to_tsvector('english', \"Name\")"`
    	settings := ParseTagSetting(reflect.StructTag(tag).Get("gorm"), ";")
    	if v, ok := settings["EXPRESSION"]; !ok || v != `to_tsvector('english', "Name")` {
    		t.Errorf("ParseTagSetting did not handle escaped double quotes correctly: got %#v", v)
    	}
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Thu Oct 30 11:15:36 UTC 2025
    - 1.8K bytes
    - Viewed (0)
  2. schema/index.go

    				var (
    					name       string
    					tag        = strings.Join(v[1:], ":")
    					idx        = strings.IndexByte(tag, ',')
    					tagSetting = strings.Join(strings.Split(tag, ",")[1:], ",")
    					settings   = ParseTagSetting(tagSetting, ",")
    					length, _  = strconv.Atoi(settings["LENGTH"])
    				)
    
    				if idx == -1 {
    					idx = len(tag)
    				}
    
    				name = tag[0:idx]
    				if name == "" {
    					subName := field.Name
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Wed May 21 02:35:56 UTC 2025
    - 3.8K bytes
    - Viewed (0)
  3. schema/utils.go

    package schema
    
    import (
    	"context"
    	"fmt"
    	"reflect"
    	"regexp"
    	"strings"
    
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/utils"
    )
    
    var embeddedCacheKey = "embedded_cache_store"
    
    func ParseTagSetting(str string, sep string) map[string]string {
    	settings := map[string]string{}
    	names := strings.Split(str, sep)
    
    	var parsedNames []string
    	for i := 0; i < len(names); i++ {
    		s := names[i]
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Thu Oct 30 11:15:36 UTC 2025
    - 5.9K bytes
    - Viewed (0)
  4. schema/schema_helper_test.go

    	t.Run("CheckField/"+f.Name, func(t *testing.T) {
    		if fc != nil {
    			fc(f)
    		}
    
    		if f.TagSettings == nil {
    			if f.Tag != "" {
    				f.TagSettings = schema.ParseTagSetting(f.Tag.Get("gorm"), ";")
    			} else {
    				f.TagSettings = map[string]string{}
    			}
    		}
    
    		parsedField, ok := s.FieldsByDBName[f.DBName]
    		if !ok {
    			parsedField, ok = s.FieldsByName[f.Name]
    		}
    
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Thu Aug 28 02:57:17 UTC 2025
    - 7.5K bytes
    - Viewed (0)
Back to top