- Sort Score
- Result 10 results
- Languages All
Results 1 - 6 of 6 for ParseTagSetting (0.22 sec)
-
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) -
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) -
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) -
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) -
schema/field.go
} // ParseField parses reflect.StructField to Field func (schema *Schema) ParseField(fieldStruct reflect.StructField) *Field { var ( err error tagSetting = ParseTagSetting(fieldStruct.Tag.Get("gorm"), ";") ) field := &Field{ Name: fieldStruct.Name, DBName: tagSetting["COLUMN"], BindNames: []string{fieldStruct.Name},
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Sat Nov 22 03:14:36 UTC 2025 - 32.2K bytes - Viewed (0) -
schema/relationship.go
break } } if matched { return nil } } } } var ( name string idx = strings.IndexByte(str, ',') settings = ParseTagSetting(str, ",") ) // optimize match english letters and midline // The following code is basically called in for. // In order to avoid the performance problems caused by repeated compilation of regular expressions,Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Sun Nov 16 04:11:05 UTC 2025 - 23.1K bytes - Viewed (1)