Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for WithResult (0.3 sec)

  1. tests/generics_test.go

    	ctx := context.Background()
    	users := []User{{Name: "TestGenericsWithResult", Age: 18}, {Name: "TestGenericsWithResult2", Age: 18}}
    
    	result := gorm.WithResult()
    	err := gorm.G[User](DB, result).CreateInBatches(ctx, &users, 2)
    	if err != nil {
    		t.Errorf("failed to create users WithResult")
    	}
    
    	if result.RowsAffected != 2 {
    		t.Errorf("failed to get affected rows, got %d, should be %d", result.RowsAffected, 2)
    	}
    }
    
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Thu Sep 04 13:13:16 UTC 2025
    - 28K bytes
    - Viewed (0)
  2. generics.go

    	RowsAffected int64
    }
    
    func (info *result) ModifyStatement(stmt *Statement) {
    	stmt.Result = info
    }
    
    // Build implements clause.Expression interface
    func (result) Build(clause.Builder) {
    }
    
    func WithResult() *result {
    	return &result{}
    }
    
    type Interface[T any] interface {
    	Raw(sql string, values ...interface{}) ExecInterface[T]
    	Exec(ctx context.Context, sql string, values ...interface{}) error
    	CreateInterface[T]
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Thu Sep 04 13:13:16 UTC 2025
    - 15.5K bytes
    - Viewed (0)
Back to top