Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 27 for Kappen (0.14 sec)

  1. tests/create_test.go

    		ID uint
    	}
    	DB.Migrator().DropTable(&EmptyStruct{})
    
    	if err := DB.AutoMigrate(&EmptyStruct{}); err != nil {
    		t.Errorf("no error should happen when auto migrate, but got %v", err)
    	}
    
    	if err := DB.Create(&EmptyStruct{}).Error; err != nil {
    		t.Errorf("No error should happen when creating user, but got %v", err)
    	}
    }
    
    func TestCreateEmptySlice(t *testing.T) {
    	data := []User{}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
  2. tests/prepared_stmt_test.go

    	txCtx.Create(&user)
    
    	var result1 User
    	if err := txCtx.Find(&result1, user.ID).Error; err != nil {
    		t.Fatalf("no error should happen but got %v", err)
    	}
    
    	time.Sleep(time.Second)
    
    	var result2 User
    	if err := tx.Find(&result2, user.ID).Error; err != nil {
    		t.Fatalf("no error should happen but got %v", err)
    	}
    
    	user2 := *GetUser("prepared_stmt2", Config{})
    	if err := txCtx.Create(&user2).Error; err == nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 07:55:43 GMT 2024
    - 4K bytes
    - Viewed (0)
  3. tests/associations_has_many_test.go

    	}
    
    	// Append
    	DB.Model(&users).Association("Pets").Append(
    		&Pet{Name: "pet-slice-append-1"},
    		[]*Pet{{Name: "pet-slice-append-2-1"}, {Name: "pet-slice-append-2-2"}},
    		&Pet{Name: "pet-slice-append-3"},
    	)
    
    	AssertAssociationCount(t, users, "Pets", 10, "After Append")
    
    	// Replace -> same as append
    	DB.Model(&users).Association("Pets").Replace(
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 15.6K bytes
    - Viewed (0)
  4. callbacks.go

    				if curIdx := getRIndex(sorted, c.name); curIdx == -1 {
    					// if before callback already sorted, append current callback just after it
    					sorted = append(sorted[:sortedIdx], append([]string{c.name}, sorted[sortedIdx:]...)...)
    				} else if curIdx > sortedIdx {
    					return fmt.Errorf("conflicting callback %s with before %s", c.name, c.before)
    				}
    			} else if idx := getRIndex(names, c.before); idx != -1 {
    				// if before callback exists
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 8.6K bytes
    - Viewed (1)
  5. tests/connpool_test.go

    }
    
    func (c *wrapperTx) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) {
    	c.conn.got = append(c.conn.got, query)
    	return c.Tx.PrepareContext(ctx, query)
    }
    
    func (c *wrapperTx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) {
    	c.conn.got = append(c.conn.got, query)
    	return c.Tx.ExecContext(ctx, query, args...)
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Feb 06 02:54:40 GMT 2024
    - 5.5K bytes
    - Viewed (0)
  6. scan.go

    							// nested relation fields
    							relFields := make([]*schema.Field, 0, subNameCount-1)
    							relFields = append(relFields, rel.Field)
    							for _, name := range names[1 : subNameCount-1] {
    								rel = rel.FieldSchema.Relationships.Relations[name]
    								relFields = append(relFields, rel.Field)
    							}
    							// lastest name is raw dbname
    							dbName := names[subNameCount-1]
    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)
  7. callbacks/query.go

    							} else {
    								parentTableName = rel.Name
    							}
    						}
    					} else {
    						fromClause.Joins = append(fromClause.Joins, clause.Join{
    							Expression: clause.NamedExpr{SQL: join.Name, Vars: join.Conds},
    						})
    					}
    				} else {
    					fromClause.Joins = append(fromClause.Joins, clause.Join{
    						Expression: clause.NamedExpr{SQL: join.Name, Vars: join.Conds},
    					})
    				}
    			}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Jan 29 03:34:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  8. migrator/migrator.go

    			}
    		}
    
    		orderedModelNames = append(orderedModelNames, name)
    	}
    
    	for _, value := range values {
    		if v, ok := value.(string); ok {
    			results = append(results, v)
    		} else {
    			parseDependence(value, true)
    		}
    	}
    
    	for _, name := range modelNames {
    		insertIntoOrderedList(name)
    	}
    
    	for _, name := range orderedModelNames {
    		results = append(results, valuesMap[name].Statement.Dest)
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  9. chainable_api.go

    	case []string:
    		tx.Statement.Selects = v
    
    		for _, arg := range args {
    			switch arg := arg.(type) {
    			case string:
    				tx.Statement.Selects = append(tx.Statement.Selects, arg)
    			case []string:
    				tx.Statement.Selects = append(tx.Statement.Selects, arg...)
    			default:
    				tx.AddError(fmt.Errorf("unsupported select args %v %v", query, args))
    				return
    			}
    		}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  10. tests/callbacks_test.go

    )
    
    func assertCallbacks(v interface{}, fnames []string) (result bool, msg string) {
    	var (
    		got   []string
    		funcs = reflect.ValueOf(v).Elem().FieldByName("fns")
    	)
    
    	for i := 0; i < funcs.Len(); i++ {
    		got = append(got, getFuncName(funcs.Index(i)))
    	}
    
    	return fmt.Sprint(got) == fmt.Sprint(fnames), fmt.Sprintf("expects %v, got %v", fnames, got)
    }
    
    func getFuncName(fc interface{}) string {
    	reflectValue, ok := fc.(reflect.Value)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 7.2K bytes
    - Viewed (0)
Back to top