Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 41 for Franke (0.18 sec)

  1. schema/relationship.go

    		refForeignFields = []*Field{}
    		for _, foreignKey := range relation.primaryKeys {
    			if field := relation.FieldSchema.LookUpField(foreignKey); field != nil {
    				refForeignFields = append(refForeignFields, field)
    			} else {
    				schema.err = fmt.Errorf("invalid foreign key: %s", foreignKey)
    				return
    			}
    		}
    	}
    
    	for idx, ownField := range ownForeignFields {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
  2. utils/utils_test.go

    package utils
    
    import (
    	"database/sql"
    	"database/sql/driver"
    	"errors"
    	"math"
    	"strings"
    	"testing"
    	"time"
    )
    
    func TestIsValidDBNameChar(t *testing.T) {
    	for _, db := range []string{"db", "dbName", "db_name", "db1", "1dbname", "db$name"} {
    		if fields := strings.FieldsFunc(db, IsValidDBNameChar); len(fields) != 1 {
    			t.Fatalf("failed to parse db name %v", db)
    		}
    	}
    }
    
    func TestCheckTruth(t *testing.T) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Feb 19 03:42:25 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  3. clause/where.go

    func (not NotConditions) Build(builder Builder) {
    	anyNegationBuilder := false
    	for _, c := range not.Exprs {
    		if _, ok := c.(NegationExpressionBuilder); ok {
    			anyNegationBuilder = true
    			break
    		}
    	}
    
    	if anyNegationBuilder {
    		if len(not.Exprs) > 1 {
    			builder.WriteByte('(')
    		}
    
    		for idx, c := range not.Exprs {
    			if idx > 0 {
    				builder.WriteString(AndWithSpace)
    			}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 5.1K bytes
    - Viewed (0)
  4. schema/schema.go

    			for _, field := range schema.PrimaryFields {
    				if field.AutoIncrement {
    					schema.PrioritizedPrimaryField = field
    					break
    				}
    			}
    		}
    	}
    
    	for _, field := range schema.PrimaryFields {
    		schema.PrimaryFieldDBNames = append(schema.PrimaryFieldDBNames, field.DBName)
    	}
    
    	for _, field := range schema.Fields {
    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)
  5. schema/constraint_test.go

    			Constraint: "name <> 'jinzhu'",
    		},
    	}
    
    	checks := user.ParseCheckConstraints()
    
    	for k, result := range results {
    		v, ok := checks[k]
    		if !ok {
    			t.Errorf("Failed to found check %v from parsed checks %+v", k, checks)
    		}
    
    		for _, name := range []string{"Name", "Constraint"} {
    			if reflect.ValueOf(result).FieldByName(name).Interface() != reflect.ValueOf(v).FieldByName(name).Interface() {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 2.2K bytes
    - Viewed (0)
  6. clause/expression_test.go

    		},
    		ExpectedVars: []interface{}{100},
    		Result:       "SUM(`users`.`id`) >= ?",
    	}}
    
    	for idx, result := range results {
    		for idy, expression := range result.Expressions {
    			t.Run(fmt.Sprintf("case #%v.%v", idx, idy), func(t *testing.T) {
    				user, _ := schema.Parse(&tests.User{}, &sync.Map{}, db.NamingStrategy)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Aug 10 05:34:33 GMT 2023
    - 8.4K bytes
    - Viewed (0)
  7. tests/query_test.go

    		t.Errorf("got error when pluck id: %v", err)
    	}
    
    	for idx, name := range names {
    		if name != users[idx].Name {
    			t.Errorf("Unexpected result on pluck name, got %+v", names)
    		}
    	}
    
    	for idx, id := range ids {
    		if int(id) != int(users[idx].ID) {
    			t.Errorf("Unexpected result on pluck id, got %+v", ids)
    		}
    	}
    
    	for idx, id := range ids2 {
    		if int(id) != int(users[idx].ID+1) {
    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)
  8. gorm.go

    	if config != c {
    		*config = *c
    	}
    	return nil
    }
    
    // AfterInitialize initialize plugins after db connected
    func (c *Config) AfterInitialize(db *DB) error {
    	if db != nil {
    		for _, plugin := range c.Plugins {
    			if err := plugin.Initialize(db); err != nil {
    				return err
    			}
    		}
    	}
    	return nil
    }
    
    // Option gorm option interface
    type Option interface {
    	Apply(*Config) error
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun Aug 20 11:46:56 GMT 2023
    - 11.6K bytes
    - Viewed (0)
  9. clause/locking_test.go

    			"SELECT * FROM `users` FOR UPDATE SKIP LOCKED", nil,
    		},
    	}
    
    	for idx, result := range results {
    		t.Run(fmt.Sprintf("case #%v", idx), func(t *testing.T) {
    			checkBuildClauses(t, result.Clauses, result.Result, result.Vars)
    		})
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:32:56 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  10. schema/field.go

    					rv     = reflect.Indirect(v)
    					rvType = rv.Type()
    				)
    
    				if rv.Kind() == reflect.Struct && !rvType.ConvertibleTo(TimeReflectType) {
    					for i := 0; i < rvType.NumField(); i++ {
    						for key, value := range ParseTagSetting(rvType.Field(i).Tag.Get("gorm"), ";") {
    							if _, ok := field.TagSettings[key]; !ok {
    								field.TagSettings[key] = value
    							}
    						}
    					}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
Back to top