Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for GormDataType (0.19 sec)

  1. schema/interfaces.go

    type ConstraintInterface interface {
    	GetName() string
    	Build() (sql string, vars []interface{})
    }
    
    // GormDataTypeInterface gorm data type interface
    type GormDataTypeInterface interface {
    	GormDataType() string
    }
    
    // FieldNewValuePool field new scan value pool
    type FieldNewValuePool interface {
    	Get() interface{}
    	Put(interface{})
    }
    
    // CreateClausesInterface create clauses interface
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 980 bytes
    - Viewed (0)
  2. schema/relationship.go

    		// use same data type for foreign keys
    		if copyableDataType(primaryKeyField.DataType) {
    			relation.Polymorphic.PolymorphicID.DataType = primaryKeyField.DataType
    		}
    		relation.Polymorphic.PolymorphicID.GORMDataType = primaryKeyField.GORMDataType
    		if relation.Polymorphic.PolymorphicID.Size == 0 {
    			relation.Polymorphic.PolymorphicID.Size = primaryKeyField.Size
    		}
    
    		relation.References = append(relation.References, &Reference{
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
  3. schema/field.go

    		} else if strings.ToUpper(v) == "MILLI" {
    			field.AutoUpdateTime = UnixMillisecond
    		} else {
    			field.AutoUpdateTime = UnixSecond
    		}
    	}
    
    	if field.GORMDataType == "" {
    		field.GORMDataType = field.DataType
    	}
    
    	if val, ok := field.TagSettings["TYPE"]; ok {
    		switch DataType(strings.ToLower(val)) {
    		case Bool, Int, Uint, Float, String, Time, Bytes:
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  4. tests/scanner_valuer_test.go

    	case []byte:
    		return json.Unmarshal(value, l)
    	default:
    		return errors.New("not supported")
    	}
    }
    
    type ExampleStruct struct {
    	Name string
    	Val  string
    }
    
    func (ExampleStruct) GormDataType() string {
    	return "bytes"
    }
    
    func (s ExampleStruct) Value() (driver.Value, error) {
    	if len(s.Name) == 0 {
    		return nil, nil
    	}
    	// for test, has no practical meaning
    	s.Name = ""
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  5. gorm.go

    		f := joinSchema.LookUpField(ref.ForeignKey.DBName)
    		if f == nil {
    			return fmt.Errorf("missing field %s for join table", ref.ForeignKey.DBName)
    		}
    
    		f.DataType = ref.ForeignKey.DataType
    		f.GORMDataType = ref.ForeignKey.GORMDataType
    		if f.Size == 0 {
    			f.Size = ref.ForeignKey.Size
    		}
    		ref.ForeignKey = f
    	}
    
    	for name, rel := range relation.JoinTable.Relationships.Relations {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sun Aug 20 11:46:56 GMT 2023
    - 11.6K bytes
    - Viewed (0)
  6. schema/schema.go

    			schema.FieldsWithDefaultDBValue = append(schema.FieldsWithDefaultDBValue, field)
    		}
    	}
    
    	if field := schema.PrioritizedPrimaryField; field != nil {
    		switch field.GORMDataType {
    		case Int, Uint:
    			if _, ok := field.TagSettings["AUTOINCREMENT"]; !ok {
    				if !field.HasDefaultValue || field.DefaultValueInterface != nil {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Tue Oct 10 06:50:29 GMT 2023
    - 13.7K bytes
    - Viewed (0)
  7. migrator/migrator.go

    			alterColumn = true
    		} else if !dvNotNull && currentDefaultNotNull {
    			// null -> default value
    			alterColumn = true
    		} else if currentDefaultNotNull || dvNotNull {
    			switch field.GORMDataType {
    			case schema.Time:
    				if !strings.EqualFold(strings.TrimSuffix(dv, "()"), strings.TrimSuffix(field.DefaultValue, "()")) {
    					alterColumn = true
    				}
    			case schema.Bool:
    				v1, _ := strconv.ParseBool(dv)
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 28.5K bytes
    - Viewed (0)
Back to top