Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 101 for type (0.14 sec)

  1. migrator/column_type.go

    // are not included.
    // Common type names include "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL",
    // "INT", and "BIGINT".
    func (ct ColumnType) DatabaseTypeName() string {
    	if ct.DataTypeValue.Valid {
    		return ct.DataTypeValue.String
    	}
    	return ct.SQLColumnType.DatabaseTypeName()
    }
    
    // ColumnType returns the database type of the column. like `varchar(16)`
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 24 01:31:58 GMT 2022
    - 3.3K bytes
    - Viewed (0)
  2. migrator/table_type.go

    }
    
    // Type returns the type of the table.
    func (ct TableType) Type() string {
    	return ct.TypeValue
    }
    
    // Comment returns the comment of current table.
    func (ct TableType) Comment() (comment string, ok bool) {
    	return ct.CommentValue.String, ct.CommentValue.Valid
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri May 05 07:58:27 GMT 2023
    - 688 bytes
    - Viewed (0)
  3. schema/relationship_test.go

    				},
    			},
    		})
    	})
    
    	t.Run("has one with custom polymorphic type and id", func(t *testing.T) {
    		type Toy struct {
    			ID    int
    			Name  string
    			RefId int
    			Type  string
    		}
    
    		type Cat struct {
    			ID   int
    			Name string
    			Toy  Toy `gorm:"polymorphic:Owner;polymorphicType:Type;polymorphicId:RefId"`
    		}
    
    		s, err := schema.Parse(&Cat{}, &sync.Map{}, schema.NamingStrategy{})
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  4. tests/embedded_struct_test.go

    	DB.Create(&HNPost{BasePost: &BasePost{Title: "embedded_pointer_type"}})
    
    	var hnPost HNPost
    	if err := DB.First(&hnPost, "title = ?", "embedded_pointer_type").Error; err != nil {
    		t.Errorf("No error should happen when find embedded pointer type, but got %v", err)
    	}
    
    	if hnPost.Title != "embedded_pointer_type" {
    		t.Errorf("Should find correct value for embedded pointer type")
    	}
    
    	if hnPost.Author != nil {
    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. schema/serializer.go

    }
    
    // SerializerInterface serializer interface
    type SerializerInterface interface {
    	Scan(ctx context.Context, field *Field, dst reflect.Value, dbValue interface{}) error
    	SerializerValuerInterface
    }
    
    // SerializerValuerInterface serializer valuer interface
    type SerializerValuerInterface interface {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 08:28:46 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  6. scan.go

    				update = false
    				if isArrayKind {
    					db.Statement.ReflectValue.Set(reflect.Zero(reflectValue.Type()))
    				} else {
    					// if the slice cap is externally initialized, the externally initialized slice is directly used here
    					if reflectValue.Cap() == 0 {
    						db.Statement.ReflectValue.Set(reflect.MakeSlice(reflectValue.Type(), 0, 20))
    					} else {
    						reflectValue.SetLen(0)
    						db.Statement.ReflectValue.Set(reflectValue)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 09:53:11 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  7. schema/constraint.go

    package schema
    
    import (
    	"regexp"
    	"strings"
    
    	"gorm.io/gorm/clause"
    )
    
    // reg match english letters and midline
    var regEnLetterAndMidline = regexp.MustCompile(`^[\w-]+$`)
    
    type CheckConstraint struct {
    	Name       string
    	Constraint string // length(phone) >= 10
    	*Field
    }
    
    func (chk *CheckConstraint) GetName() string { return chk.Name }
    
    func (chk *CheckConstraint) Build() (sql string, vars []interface{}) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 07:33:54 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  8. callbacks.go

    			"row":    {db: db},
    			"raw":    {db: db},
    		},
    	}
    }
    
    // callbacks gorm callbacks manager
    type callbacks struct {
    	processors map[string]*processor
    }
    
    type processor struct {
    	db        *DB
    	Clauses   []string
    	fns       []func(*DB)
    	callbacks []*callback
    }
    
    type callback struct {
    	name      string
    	before    string
    	after     string
    	remove    bool
    	replace   bool
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 8.6K bytes
    - Viewed (1)
  9. clause/with.go

    package clause
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 35 bytes
    - Viewed (0)
  10. tests/update_has_one_test.go

    		var pet4 Pet
    		DB.Preload("Toy").Find(&pet4, "id = ?", pet.ID)
    		CheckPet(t, pet4, pet)
    	})
    
    	t.Run("Restriction", func(t *testing.T) {
    		type CustomizeAccount struct {
    			gorm.Model
    			UserID  sql.NullInt64
    			Number  string `gorm:"<-:create"`
    			Number2 string
    		}
    
    		type CustomizeUser struct {
    			gorm.Model
    			Name    string
    			Account CustomizeAccount `gorm:"foreignkey:UserID"`
    		}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jul 14 06:55:54 GMT 2022
    - 3.6K bytes
    - Viewed (0)
Back to top