Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 78 for Clausen (0.2 sec)

  1. statement_test.go

    			s1.AddClause(clause.Where{
    				Exprs: s.BuildCondition("FINAL1"),
    			})
    			s2 := s.clone()
    			s2.AddClause(clause.Where{
    				Exprs: s.BuildCondition("FINAL2"),
    			})
    
    			if reflect.DeepEqual(s1.Clauses["WHERE"], s2.Clauses["WHERE"]) {
    				t.Errorf("Where conditions should be different")
    			}
    		})
    	}
    }
    
    func TestNilCondition(t *testing.T) {
    	s := new(Statement)
    	if len(s.BuildCondition(nil)) != 0 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Dec 23 13:19:41 GMT 2023
    - 1.9K bytes
    - Viewed (0)
  2. callbacks/update.go

    					stmt.AddClause(clause.Where{Exprs: []clause.Expression{clause.IN{Column: column, Values: values}}})
    				}
    			}
    		case reflect.Struct:
    			for _, field := range stmt.Schema.PrimaryFields {
    				if value, isZero := field.ValueOf(stmt.Context, stmt.ReflectValue); !isZero {
    					stmt.AddClause(clause.Where{Exprs: []clause.Expression{clause.Eq{Column: field.DBName, Value: value}}})
    				}
    			}
    		}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 05:44:55 GMT 2024
    - 9.4K bytes
    - Viewed (1)
  3. tests/delete_test.go

    		GetUser("delete-returning-2", Config{}),
    		GetUser("delete-returning-3", Config{}),
    	}
    	DB.Create(&users)
    
    	var results []User
    	DB.Where("name IN ?", []string{users[0].Name, users[1].Name}).Clauses(clause.Returning{}).Delete(&results)
    	if len(results) != 2 {
    		t.Errorf("failed to return delete data, got %v", results)
    	}
    
    	var count int64
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 10 07:03:34 GMT 2023
    - 9.4K bytes
    - Viewed (0)
  4. callbacks/callbacks.go

    	updateCallback.Clauses = config.UpdateClauses
    
    	rowCallback := db.Callback().Row()
    	rowCallback.Register("gorm:row", RowQuery)
    	rowCallback.Clauses = config.QueryClauses
    
    	rawCallback := db.Callback().Raw()
    	rawCallback.Register("gorm:raw", RawExec)
    	rawCallback.Clauses = config.QueryClauses
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Oct 27 23:56:55 GMT 2021
    - 3.3K bytes
    - Viewed (0)
  5. utils/tests/dummy_dialecter.go

    }
    
    func (DummyDialector) DefaultValueOf(field *schema.Field) clause.Expression {
    	return clause.Expr{SQL: "DEFAULT"}
    }
    
    func (DummyDialector) Migrator(*gorm.DB) gorm.Migrator {
    	return nil
    }
    
    func (DummyDialector) BindVarTo(writer clause.Writer, stmt *gorm.Statement, v interface{}) {
    	writer.WriteByte('?')
    }
    
    func (DummyDialector) QuoteTo(writer clause.Writer, str string) {
    	var (
    		underQuoted, selfQuoted bool
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 06 06:03:31 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  6. interfaces.go

    import (
    	"context"
    	"database/sql"
    
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/schema"
    )
    
    // Dialector GORM database dialector
    type Dialector interface {
    	Name() string
    	Initialize(*DB) error
    	Migrator(db *DB) Migrator
    	DataTypeOf(*schema.Field) string
    	DefaultValueOf(*schema.Field) clause.Expression
    	BindVarTo(writer clause.Writer, stmt *Statement, v interface{})
    	QuoteTo(clause.Writer, string)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Aug 19 13:33:31 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  7. 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 May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  8. 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 May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  9. tests/joins_table_test.go

    package tests_test
    
    import (
    	"testing"
    	"time"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    )
    
    type Person struct {
    	ID        int
    	Name      string
    	Addresses []Address `gorm:"many2many:person_addresses;"`
    	DeletedAt gorm.DeletedAt
    }
    
    type Address struct {
    	ID   uint
    	Name string
    }
    
    type PersonAddress struct {
    	PersonID  int
    	AddressID int
    	CreatedAt time.Time
    	DeletedAt gorm.DeletedAt
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Sep 10 13:46:18 GMT 2020
    - 3.5K bytes
    - Viewed (0)
  10. clause/clause_test.go

    		stmt          = gorm.Statement{DB: db, Table: user.Table, Schema: user, Clauses: map[string]clause.Clause{}}
    	)
    
    	for _, c := range clauses {
    		if _, ok := buildNamesMap[c.Name()]; !ok {
    			buildNames = append(buildNames, c.Name())
    			buildNamesMap[c.Name()] = true
    		}
    
    		stmt.AddClause(c)
    	}
    
    	stmt.Build(buildNames...)
    
    	if strings.TrimSpace(stmt.SQL.String()) != result {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Jun 02 02:50:38 GMT 2020
    - 1012 bytes
    - Viewed (0)
Back to top