Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for DataTypeOf (0.08 sec)

  1. migrator/migrator.go

    	}
    
    	return fc(stmt)
    }
    
    // DataTypeOf return field's db data type
    func (m Migrator) DataTypeOf(field *schema.Field) string {
    	fieldValue := reflect.New(field.IndirectFieldType)
    	if dataTyper, ok := fieldValue.Interface().(GormDataTypeInterface); ok {
    		if dataType := dataTyper.GormDBDataType(m.DB, field); dataType != "" {
    			return dataType
    		}
    	}
    
    	return m.Dialector.DataTypeOf(field)
    }
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Fri Apr 26 07:15:49 UTC 2024
    - 29K bytes
    - Viewed (0)
  2. interfaces.go

    	"database/sql"
    
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/schema"
    )
    
    // Dialector GORM database dialector
    type Dialector interface {
    	Name() string
    	Initialize(*DB) error
    	Migrator(db *DB) Migrator
    	DataTypeOf(*schema.Field) string
    	DefaultValueOf(*schema.Field) clause.Expression
    	BindVarTo(writer clause.Writer, stmt *Statement, v interface{})
    	QuoteTo(clause.Writer, string)
    	Explain(sql string, vars ...interface{}) string
    }
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Sat Aug 19 13:33:31 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  3. utils/tests/dummy_dialecter.go

    		writer.WriteString("``")
    	}
    	writer.WriteByte('`')
    }
    
    func (DummyDialector) Explain(sql string, vars ...interface{}) string {
    	return logger.ExplainSQL(sql, nil, `"`, vars...)
    }
    
    func (DummyDialector) DataTypeOf(*schema.Field) string {
    	return ""
    }
    
    func (d DummyDialector) Translate(err error) error {
    	return d.TranslatedErr
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Mar 06 06:03:31 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  4. tests/migrate_test.go

    					t.Fatalf("column id primary key should be correct, name: %v, column: %#v", columnType.Name(),
    						columnType)
    				}
    			case "name":
    				dataType := DB.Dialector.DataTypeOf(stmt.Schema.LookUpField(columnType.Name()))
    				if !strings.Contains(strings.ToUpper(dataType), strings.ToUpper(columnType.DatabaseTypeName())) {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Mar 18 11:24:16 UTC 2024
    - 56.2K bytes
    - Viewed (0)
Back to top