Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 83 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. 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)
  4. 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)
  5. clause/order_by.go

    package clause
    
    type OrderByColumn struct {
    	Column  Column
    	Desc    bool
    	Reorder bool
    }
    
    type OrderBy struct {
    	Columns    []OrderByColumn
    	Expression Expression
    }
    
    // Name where clause name
    func (orderBy OrderBy) Name() string {
    	return "ORDER BY"
    }
    
    // Build build where clause
    func (orderBy OrderBy) Build(builder Builder) {
    	if orderBy.Expression != nil {
    		orderBy.Expression.Build(builder)
    	} else {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Nov 03 02:30:05 GMT 2020
    - 1.1K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. 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)
  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. clause/returning.go

    package clause
    
    type Returning struct {
    	Columns []Column
    }
    
    // Name where clause name
    func (returning Returning) Name() string {
    	return "RETURNING"
    }
    
    // Build build where clause
    func (returning Returning) Build(builder Builder) {
    	if len(returning.Columns) > 0 {
    		for idx, column := range returning.Columns {
    			if idx > 0 {
    				builder.WriteByte(',')
    			}
    
    			builder.WriteQuoted(column)
    		}
    	} else {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Oct 27 23:56:55 GMT 2021
    - 681 bytes
    - Viewed (0)
Back to top