Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for nilable (0.31 sec)

  1. migrator/migrator.go

    				alterColumn = true
    			}
    		}
    	}
    
    	// check nullable
    	if nullable, ok := columnType.Nullable(); ok && nullable == field.NotNull {
    		// not primary key & database is nullable
    		if !field.PrimaryKey && nullable {
    			alterColumn = true
    		}
    	}
    
    	// check default value
    	if !field.PrimaryKey {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  2. migrator/column_type.go

    		return ct.DecimalSizeValue.Int64, ct.ScaleValue.Int64, true
    	}
    	return ct.SQLColumnType.DecimalSize()
    }
    
    // Nullable reports whether the column may be null.
    func (ct ColumnType) Nullable() (nullable bool, ok bool) {
    	if ct.NullableValue.Valid {
    		return ct.NullableValue.Bool, true
    	}
    	return ct.SQLColumnType.Nullable()
    }
    
    // Unique reports whether the column may be unique.
    func (ct ColumnType) Unique() (unique bool, ok bool) {
    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)
  3. migrator.go

    	PrimaryKey() (isPrimaryKey bool, ok bool)
    	AutoIncrement() (isAutoIncrement bool, ok bool)
    	Length() (length int64, ok bool)
    	DecimalSize() (precision int64, scale int64, ok bool)
    	Nullable() (nullable bool, ok bool)
    	Unique() (unique bool, ok bool)
    	ScanType() reflect.Type
    	Comment() (value string, ok bool)
    	DefaultValue() (value string, ok bool)
    }
    
    type Index interface {
    	Table() string
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  4. gorm.go

    const preparedStmtDBKey = "preparedStmt"
    
    // Config GORM config
    type Config struct {
    	// GORM perform single create, update, delete operations in transactions by default to ensure database data integrity
    	// You can disable it by setting `SkipDefaultTransaction` to true
    	SkipDefaultTransaction bool
    	// NamingStrategy tables, columns naming strategy
    	NamingStrategy schema.Namer
    	// FullSaveAssociations full save associations
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun Aug 20 11:46:56 GMT 2023
    - 11.6K bytes
    - Viewed (0)
  5. tests/tests_test.go

    )
    
    var DB *gorm.DB
    var (
    	mysqlDSN     = "gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8&parseTime=True&loc=Local"
    	postgresDSN  = "user=gorm password=gorm dbname=gorm host=localhost port=9920 sslmode=disable TimeZone=Asia/Shanghai"
    	sqlserverDSN = "sqlserver://gorm:LoremIpsum86@localhost:9930?database=gorm"
    	tidbDSN      = "root:@tcp(localhost:9940)/test?charset=utf8&parseTime=True&loc=Local"
    )
    
    func init() {
    	var err error
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 3.3K bytes
    - Viewed (1)
Back to top