Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for tagSettings (0.2 sec)

  1. schema/schema_test.go

    		{Name: "ID", DBName: "company_id", BindNames: []string{"Base", "ID"}, DataType: schema.Int, Size: 64, TagSettings: map[string]string{"EMBEDDED": "EMBEDDED", "EMBEDDEDPREFIX": "company_"}},
    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)
  2. schema/field.go

    		Tag:                    fieldStruct.Tag,
    		TagSettings:            tagSetting,
    		Schema:                 schema,
    		Creatable:              true,
    		Updatable:              true,
    		Readable:               true,
    		PrimaryKey:             utils.CheckTruth(tagSetting["PRIMARYKEY"], tagSetting["PRIMARY_KEY"]),
    		AutoIncrement:          utils.CheckTruth(tagSetting["AUTOINCREMENT"]),
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  3. schema/relationship.go

    // 1. `POLYMORPHIC` tag
    // 2. `POLYMORPHICTYPE` and `POLYMORPHICID` tag
    func hasPolymorphicRelation(tagSettings map[string]string) bool {
    	if _, ok := tagSettings["POLYMORPHIC"]; ok {
    		return true
    	}
    
    	_, hasType := tagSettings["POLYMORPHICTYPE"]
    	_, hasId := tagSettings["POLYMORPHICID"]
    
    	return hasType && hasId
    }
    
    func (schema *Schema) setRelation(relation *Relationship) {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
  4. schema/index.go

    	priority   int
    }
    
    // ParseIndexes parse schema indexes
    func (schema *Schema) ParseIndexes() map[string]Index {
    	indexes := map[string]Index{}
    
    	for _, field := range schema.Fields {
    		if field.TagSettings["INDEX"] != "" || field.TagSettings["UNIQUEINDEX"] != "" {
    			fieldIndexes, err := parseFieldIndexes(field)
    			if err != nil {
    				schema.err = err
    				break
    			}
    			for _, index := range fieldIndexes {
    				idx := indexes[index.Name]
    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)
  5. 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]
    		}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  6. schema/schema.go

    					schema.PrimaryFields = append(schema.PrimaryFields, field)
    				}
    			}
    		}
    
    		if of, ok := schema.FieldsByName[field.Name]; !ok || of.TagSettings["-"] == "-" {
    			schema.FieldsByName[field.Name] = field
    		}
    		if of, ok := schema.FieldsByBindName[bindName]; !ok || of.TagSettings["-"] == "-" {
    			schema.FieldsByBindName[bindName] = field
    		}
    
    		field.setupValuerAndSetter()
    	}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Oct 10 06:50:29 GMT 2023
    - 13.7K bytes
    - Viewed (0)
  7. 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]) {
    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)
  8. soft_delete.go

    	return []clause.Interface{SoftDeleteQueryClause{Field: f, ZeroValue: parseZeroValueTag(f)}}
    }
    
    func parseZeroValueTag(f *schema.Field) sql.NullString {
    	if v, ok := f.TagSettings["ZEROVALUE"]; ok {
    		if _, err := now.Parse(v); err == nil {
    			return sql.NullString{String: v, Valid: true}
    		}
    	}
    	return sql.NullString{Valid: false}
    }
    
    type SoftDeleteQueryClause struct {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Feb 01 06:40:55 GMT 2023
    - 4.5K bytes
    - Viewed (0)
  9. schema/serializer.go

    func (JSONSerializer) Value(ctx context.Context, field *Field, dst reflect.Value, fieldValue interface{}) (interface{}, error) {
    	result, err := json.Marshal(fieldValue)
    	if string(result) == "null" {
    		if field.TagSettings["NOT NULL"] != "" {
    			return "", nil
    		}
    		return nil, err
    	}
    	return string(result), err
    }
    
    // UnixSecondSerializer json serializer
    type UnixSecondSerializer struct{}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 08:28:46 GMT 2024
    - 4.6K bytes
    - Viewed (0)
Back to top