Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for ColumnTypes (0.25 sec)

  1. scan.go

    	)
    
    	db.RowsAffected = 0
    
    	switch dest := db.Statement.Dest.(type) {
    	case map[string]interface{}, *map[string]interface{}:
    		if initialized || rows.Next() {
    			columnTypes, _ := rows.ColumnTypes()
    			prepareValues(values, db, columnTypes, columns)
    
    			db.RowsAffected++
    			db.AddError(rows.Scan(values...))
    
    			mapValue, ok := dest.(map[string]interface{})
    			if !ok {
    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)
  2. tests/migrate_test.go

    		t.Fatalf("no error should happened when auto migrate column, but got %v", err)
    	}
    
    	if columnTypes, err := DB.Migrator().ColumnTypes(&ColumnStruct{}); err != nil {
    		t.Fatalf("no error should returns for ColumnTypes")
    	} else {
    		stmt := &gorm.Statement{DB: DB}
    		stmt.Parse(&ColumnStruct2{})
    
    		for _, columnType := range columnTypes {
    			switch columnType.Name() {
    			case "id":
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  3. migrator/migrator.go

    		}
    		if !unique && field.Unique {
    			return m.DB.Migrator().CreateConstraint(value, constraint)
    		}
    		return nil
    	})
    }
    
    // ColumnTypes return columnTypes []gorm.ColumnType and execErr error
    func (m Migrator) ColumnTypes(value interface{}) ([]gorm.ColumnType, error) {
    	columnTypes := make([]gorm.ColumnType, 0)
    	execErr := m.RunWithValue(value, func(stmt *gorm.Statement) (err error) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
Back to top