Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 24 for Krause (0.2 sec)

  1. tests/scanner_valuer_test.go

    	sql.NullString
    }
    
    type Point struct {
    	X, Y int
    }
    
    func (point Point) GormDataType() string {
    	return "geo"
    }
    
    func (point Point) GormValue(ctx context.Context, db *gorm.DB) clause.Expr {
    	return clause.Expr{
    		SQL:  "ST_PointFromText(?)",
    		Vars: []interface{}{fmt.Sprintf("POINT(%d %d)", point.X, point.Y)},
    	}
    }
    
    func TestGORMValuer(t *testing.T) {
    	type UserWithPoint struct {
    		Name  string
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  2. tests/transaction_test.go

    	user := User{Name: "transaction"}
    	if err := tx.Save(&user).Error; err != nil {
    		t.Fatalf("No error should raise")
    	}
    
    	if err := tx.Commit().Error; err != nil {
    		t.Fatalf("Commit should not raise error")
    	}
    
    	if err := tx.Rollback().Error; err == nil {
    		t.Fatalf("Rollback after commit should raise error")
    	}
    }
    
    func TestTransactionWithSavePoint(t *testing.T) {
    	tx := DB.Begin()
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  3. tests/update_test.go

    		t.Errorf("Not error should happen when updating with gorm expr, but got %v", err)
    	}
    
    	if err := DB.Model(&results[1]).Clauses(clause.Returning{Columns: []clause.Column{{Name: "age"}}}).Updates(map[string]interface{}{"age": gorm.Expr("age + ?", 100)}).Error; err != nil {
    		t.Errorf("Not error should happen when updating with gorm expr, but got %v", err)
    	}
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  4. statement.go

    						if len(values) > 0 {
    							conds = append(conds, clause.IN{Column: clause.PrimaryColumn, Values: values})
    							return []clause.Expression{clause.And(conds...)}
    						}
    						return nil
    					}
    				}
    
    				conds = append(conds, clause.IN{Column: clause.PrimaryColumn, Values: args})
    			}
    		}
    	}
    
    	if len(conds) > 0 {
    		return []clause.Expression{clause.And(conds...)}
    	}
    	return nil
    }
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
  5. tests/preload_test.go

    	CheckUser(t, user, user)
    
    	var user2 User
    	DB.Preload(clause.Associations).Find(&user2, "id = ?", user.ID)
    	CheckUser(t, user2, user)
    
    	user3 := *GetUser("preload_with_associations_new", Config{
    		Account:   true,
    		Pets:      2,
    		Toys:      3,
    		Company:   true,
    		Manager:   true,
    		Team:      4,
    		Languages: 3,
    		Friends:   1,
    	})
    
    	DB.Preload(clause.Associations).Find(&user3, "id = ?", user.ID)
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 13.4K bytes
    - Viewed (0)
  6. callbacks/preload.go

    import (
    	"fmt"
    	"reflect"
    	"sort"
    	"strings"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils"
    )
    
    // parsePreloadMap extracts nested preloads. e.g.
    //
    //	// schema has a "k0" relation and a "k7.k8" embedded relation
    //	parsePreloadMap(schema, map[string][]interface{}{
    //		clause.Associations: {"arg1"},
    //		"k1":                {"arg2"},
    //		"k2.k3":             {"arg3"},
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 11.3K bytes
    - Viewed (0)
  7. schema/schema.go

    	FieldsWithDefaultDBValue  []*Field // fields with default value assigned by database
    	Relationships             Relationships
    	CreateClauses             []clause.Interface
    	QueryClauses              []clause.Interface
    	UpdateClauses             []clause.Interface
    	DeleteClauses             []clause.Interface
    	BeforeCreate, AfterCreate bool
    	BeforeUpdate, AfterUpdate bool
    	BeforeDelete, AfterDelete bool
    	BeforeSave, AfterSave     bool
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Tue Oct 10 06:50:29 GMT 2023
    - 13.7K bytes
    - Viewed (0)
  8. tests/create_test.go

    	CheckUser(t, result, user)
    
    	user2 := *GetUser("omit_create", Config{Account: true, Pets: 3, Toys: 3, Company: true, Manager: true, Team: 3, Languages: 3, Friends: 4})
    	DB.Omit(clause.Associations).Create(&user2)
    
    	var result2 User
    	DB.Preload(clause.Associations).First(&result2, user2.ID)
    
    	user2.Account = Account{}
    	user2.Toys = nil
    	user2.Manager = nil
    	user2.Company = Company{}
    	user2.Pets = nil
    	user2.Team = nil
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
  9. tests/associations_many2many_test.go

    package tests_test
    
    import (
    	"fmt"
    	"sync"
    	"testing"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    	. "gorm.io/gorm/utils/tests"
    )
    
    func TestMany2ManyAssociation(t *testing.T) {
    	user := *GetUser("many2many", Config{Languages: 2})
    
    	if err := DB.Create(&user).Error; err != nil {
    		t.Fatalf("errors happened when create: %v", err)
    	}
    
    	CheckUser(t, user, user)
    
    	// Find
    	var user2 User
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 13.2K bytes
    - Viewed (0)
  10. association.go

    			Table: clause.Table{Name: association.Relationship.JoinTable.Table},
    			ON:    clause.Where{Exprs: queryConds},
    		}}})
    	} else {
    		tx.Clauses(clause.Where{Exprs: queryConds})
    	}
    
    	return tx
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Thu May 04 11:30:45 GMT 2023
    - 21.2K bytes
    - Viewed (0)
Back to top