Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for ColumnType (0.19 sec)

  1. migrator/column_type.go

    // "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)`
    func (ct ColumnType) ColumnType() (columnType string, ok bool) {
    	return ct.ColumnTypeValue.String, ct.ColumnTypeValue.Valid
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 24 01:31:58 GMT 2022
    - 3.3K bytes
    - Viewed (0)
  2. migrator/migrator.go

    					parseCheckConstraints = stmt.Schema.ParseCheckConstraints()
    				)
    				for _, dbName := range stmt.Schema.DBNames {
    					var foundColumn gorm.ColumnType
    
    					for _, columnType := range columnTypes {
    						if columnType.Name() == dbName {
    							foundColumn = columnType
    							break
    						}
    					}
    
    					if foundColumn == nil {
    						// not found, add column
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  3. tests/migrate_test.go

    					t.Fatalf("column name type should be correct, name: %v, length: %v, expects: %v, column: %#v",
    						columnType.Name(), columnType.DatabaseTypeName(), dataType, columnType)
    				}
    				if length, ok := columnType.Length(); !ok || length != 100 {
    					t.Fatalf("column name length should be correct, name: %v, length: %v, expects: %v, column: %#v",
    						columnType.Name(), length, 100, columnType)
    				}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  4. migrator.go

    	MigrateColumn(dst interface{}, field *schema.Field, columnType ColumnType) error
    	// MigrateColumnUnique migrate column's UNIQUE constraint, it's part of MigrateColumn.
    	MigrateColumnUnique(dst interface{}, field *schema.Field, columnType ColumnType) error
    	HasColumn(dst interface{}, field string) bool
    	RenameColumn(dst interface{}, oldName, field string) error
    	ColumnTypes(dst interface{}) ([]ColumnType, error)
    
    	// Views
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  5. api/go1.8.txt

    pkg database/sql, method (*ColumnType) DatabaseTypeName() string
    pkg database/sql, method (*ColumnType) DecimalSize() (int64, int64, bool)
    pkg database/sql, method (*ColumnType) Length() (int64, bool)
    pkg database/sql, method (*ColumnType) Name() string
    pkg database/sql, method (*ColumnType) Nullable() (bool, bool)
    pkg database/sql, method (*ColumnType) ScanType() reflect.Type
    Plain Text
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Dec 21 05:25:57 GMT 2016
    - 16.3K bytes
    - Viewed (0)
  6. scan.go

    	if db.Statement.Schema != nil {
    		for idx, name := range columns {
    			if field := db.Statement.Schema.LookUpField(name); field != nil {
    				values[idx] = reflect.New(reflect.PtrTo(field.FieldType)).Interface()
    				continue
    			}
    			values[idx] = new(interface{})
    		}
    	} else if len(columnTypes) > 0 {
    		for idx, columnType := range columnTypes {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 09:53:11 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  7. interfaces.go

    }
    
    // GetDBConnector SQL db connector
    type GetDBConnector interface {
    	GetDBConn() (*sql.DB, error)
    }
    
    // Rows rows interface
    type Rows interface {
    	Columns() ([]string, error)
    	ColumnTypes() ([]*sql.ColumnType, error)
    	Next() bool
    	Scan(dest ...interface{}) error
    	Err() error
    	Close() error
    }
    
    type ErrorTranslator interface {
    	Translate(err error) error
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Aug 19 13:33:31 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  8. schema/field.go

    	NewValuePool           FieldNewValuePool
    
    	// In some db (e.g. MySQL), Unique and UniqueIndex are indistinguishable.
    	// When a column has a (not Mul) UniqueIndex, Migrator always reports its gorm.ColumnType is Unique.
    	// It causes field unnecessarily migration.
    	// Therefore, we need to record the UniqueIndex on this column (exclude Mul UniqueIndex) for MigrateColumnUnique.
    	UniqueIndex string
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
Back to top