Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for rack (0.16 sec)

  1. tests/prepared_stmt_test.go

    )
    
    func TestPreparedStmt(t *testing.T) {
    	tx := DB.Session(&gorm.Session{PrepareStmt: true})
    
    	if _, ok := tx.ConnPool.(*gorm.PreparedStmtDB); !ok {
    		t.Fatalf("should assign PreparedStatement Manager back to database when using PrepareStmt mode")
    	}
    
    	ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond)
    	defer cancel()
    	txCtx := tx.WithContext(ctx)
    
    	user := *GetUser("prepared_stmt", Config{})
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 07:55:43 GMT 2024
    - 4K bytes
    - Viewed (0)
  2. tests/embedded_struct_test.go

    	}
    
    	if hnPost.Title != "embedded_pointer_type" {
    		t.Errorf("Should find correct value for embedded pointer type")
    	}
    
    	if hnPost.Author != nil {
    		t.Errorf("Expected to get back a nil Author but got: %v", hnPost.Author)
    	}
    
    	now := time.Now().Round(time.Second)
    	NewPost := HNPost{
    		BasePost: &BasePost{Title: "embedded_pointer_type2"},
    		Author: &Author{
    			Name:        "test",
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Oct 26 03:58:13 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  3. tests/main_test.go

    import (
    	"testing"
    
    	. "gorm.io/gorm/utils/tests"
    )
    
    func TestExceptionsWithInvalidSql(t *testing.T) {
    	if name := DB.Dialector.Name(); name == "sqlserver" {
    		t.Skip("skip sqlserver due to it will raise data race for invalid sql")
    	}
    
    	var columns []string
    	if DB.Where("sdsd.zaaa = ?", "sd;;;aa").Pluck("aaa", &columns).Error == nil {
    		t.Errorf("Should got error with invalid SQL")
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 24 01:31:58 GMT 2022
    - 1.4K bytes
    - Viewed (0)
  4. finisher_api.go

    	case reflect.Slice, reflect.Array:
    		if _, ok := tx.Statement.Clauses["ON CONFLICT"]; !ok {
    			tx = tx.Clauses(clause.OnConflict{UpdateAll: true})
    		}
    		tx = tx.callbacks.Create().Execute(tx.Set("gorm:update_track_time", true))
    	case reflect.Struct:
    		if err := tx.Statement.Parse(value); err == nil && tx.Statement.Schema != nil {
    			for _, pf := range tx.Statement.Schema.PrimaryFields {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
  5. schema/schema.go

    	}
    	for _, cbName := range callbackTypes {
    		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:
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 10 06:50:29 GMT 2023
    - 13.7K bytes
    - Viewed (0)
  6. association.go

    }
    
    func (association *Association) saveAssociation(clear bool, values ...interface{}) {
    	var (
    		reflectValue = association.DB.Statement.ReflectValue
    		assignBacks  []assignBack // assign association values back to arguments after save
    	)
    
    	appendToRelations := func(source, rv reflect.Value, clear bool) {
    		switch association.Relationship.Type {
    		case schema.HasOne, schema.BelongsTo:
    			switch rv.Kind() {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu May 04 11:30:45 GMT 2023
    - 21.2K bytes
    - Viewed (0)
  7. tests/query_test.go

    	}
    }
    
    func TestFindInBatchesWithError(t *testing.T) {
    	if name := DB.Dialector.Name(); name == "sqlserver" {
    		t.Skip("skip sqlserver due to it will raise data race for invalid sql")
    	}
    
    	users := []User{
    		*GetUser("find_in_batches_with_error", Config{}),
    		*GetUser("find_in_batches_with_error", Config{}),
    		*GetUser("find_in_batches_with_error", Config{}),
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
Back to top