Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for FieldByName (0.06 sec)

  1. tests/query_test.go

    							t.Errorf("invalid data type for %v, got %#v", dbName, first[dbName])
    						}
    					}
    
    					reflectValue := reflect.Indirect(reflect.ValueOf(users[0]))
    					AssertEqual(t, first[dbName], reflectValue.FieldByName(name).Interface())
    				})
    			}
    		}
    	})
    
    	t.Run("FirstMapWithTable", func(t *testing.T) {
    		first := map[string]interface{}{}
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Jun 24 09:42:59 UTC 2024
    - 50.4K bytes
    - Viewed (0)
  2. schema/schema.go

    		if methodValue := callBackToMethodValue(modelValue, cbName); methodValue.IsValid() {
    			switch methodValue.Type().String() {
    			case "func(*gorm.DB) error": // TODO hack
    				reflect.Indirect(reflect.ValueOf(schema)).FieldByName(string(cbName)).SetBool(true)
    			default:
    				logger.Default.Warn(context.Background(), "Model %v don't match %vInterface, should be `%v(*gorm.DB) error`. Please see https://gorm.io/docs/hooks.html", schema, cbName, cbName)
    			}
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Jun 20 12:19:31 UTC 2024
    - 13.7K bytes
    - Viewed (0)
  3. gorm.go

    	connPool := db.ConnPool
    	if db.Statement != nil && db.Statement.ConnPool != nil {
    		connPool = db.Statement.ConnPool
    	}
    	if tx, ok := connPool.(*sql.Tx); ok && tx != nil {
    		return (*sql.DB)(reflect.ValueOf(tx).Elem().FieldByName("db").UnsafePointer()), nil
    	}
    
    	if dbConnector, ok := connPool.(GetDBConnector); ok && dbConnector != nil {
    		if sqldb, err := dbConnector.GetDBConn(); sqldb != nil || err != nil {
    			return sqldb, err
    		}
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Oct 09 11:29:48 UTC 2024
    - 12.1K bytes
    - Viewed (0)
Back to top