Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for James (0.13 sec)

  1. schema/constraint.go

    		if chk := field.TagSettings["CHECK"]; chk != "" {
    			names := strings.Split(chk, ",")
    			if len(names) > 1 && regEnLetterAndMidline.MatchString(names[0]) {
    				checks[names[0]] = CheckConstraint{Name: names[0], Constraint: strings.Join(names[1:], ","), Field: field}
    			} else {
    				if names[0] == "" {
    					chk = strings.Join(names[1:], ",")
    				}
    				name := schema.namer.CheckerName(schema.Table, field.DBName)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 07:33:54 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  2. callbacks.go

    	})
    
    	for _, c := range cs {
    		// show warning message the callback name already exists
    		if idx := getRIndex(names, c.name); idx > -1 && !c.replace && !c.remove && !cs[idx].remove {
    			c.processor.db.Logger.Warn(context.Background(), "duplicated callback `%s` from %s\n", c.name, utils.FileWithLineNum())
    		}
    		names = append(names, c.name)
    	}
    
    	sortCallback = func(c *callback) error {
    		if c.before != "" { // if defined before callback
    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)
  3. scan.go

    						}
    					} else if names := utils.SplitNestedRelationName(column); len(names) > 1 { // has nested relation
    						if rel, ok := sch.Relationships.Relations[names[0]]; ok {
    							subNameCount := len(names)
    							// nested relation fields
    							relFields := make([]*schema.Field, 0, subNameCount-1)
    							relFields = append(relFields, rel.Field)
    							for _, name := range names[1 : 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)
  4. tests/distinct_test.go

    	}
    	users[0].Age = 20
    
    	if err := DB.Create(&users).Error; err != nil {
    		t.Fatalf("errors happened when create users: %v", err)
    	}
    
    	var names []string
    	DB.Table("users").Where("name like ?", "distinct%").Order("name").Pluck("name", &names)
    	AssertEqual(t, names, []string{"distinct", "distinct", "distinct", "distinct-2", "distinct-3"})
    
    	var names1 []string
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 2.5K bytes
    - Viewed (0)
  5. tests/scopes_test.go

    }
    
    func NameIn2And3(d *gorm.DB) *gorm.DB {
    	return d.Where("name in (?)", []string{"ScopeUser2", "ScopeUser3"})
    }
    
    func NameIn(names []string) func(d *gorm.DB) *gorm.DB {
    	return func(d *gorm.DB) *gorm.DB {
    		return d.Where("name in (?)", names)
    	}
    }
    
    func TestScopes(t *testing.T) {
    	users := []*User{
    		GetUser("ScopeUser1", Config{}),
    		GetUser("ScopeUser2", Config{}),
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  6. chainable_api.go

    		tx.Statement.Table = name
    	} else {
    		tx.Statement.TableExpr = nil
    		tx.Statement.Table = ""
    	}
    	return
    }
    
    // Distinct specify distinct fields that you want querying
    //
    //	// Select distinct names of users
    //	db.Distinct("name").Find(&results)
    //	// Select distinct name/age pairs from users
    //	db.Distinct("name", "age").Find(&results)
    func (db *DB) Distinct(args ...interface{}) (tx *DB) {
    	tx = db.getInstance()
    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)
  7. utils/tests/utils.go

    package tests
    
    import (
    	"database/sql/driver"
    	"fmt"
    	"go/ast"
    	"reflect"
    	"testing"
    	"time"
    
    	"gorm.io/gorm/utils"
    )
    
    func AssertObjEqual(t *testing.T, r, e interface{}, names ...string) {
    	for _, name := range names {
    		rv := reflect.Indirect(reflect.ValueOf(r))
    		ev := reflect.Indirect(reflect.ValueOf(e))
    		if rv.IsValid() != ev.IsValid() {
    			t.Errorf("%v: expect: %+v, got %+v", utils.FileWithLineNum(), r, e)
    			return
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Mar 10 09:21:56 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  8. migrator/column_type.go

    // string is returned, then the driver type name is not supported.
    // Consult your driver documentation for a list of driver data types. Length specifiers
    // are not included.
    // Common type names include "VARCHAR", "TEXT", "NVARCHAR", "DECIMAL", "BOOL",
    // "INT", and "BIGINT".
    func (ct ColumnType) DatabaseTypeName() string {
    	if ct.DataTypeValue.Valid {
    		return ct.DataTypeValue.String
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 24 01:31:58 GMT 2022
    - 3.3K bytes
    - Viewed (0)
  9. tests/migrate_test.go

    		t.Fatalf("Found deleted column")
    	}
    }
    
    func TestMigrateConstraint(t *testing.T) {
    	names := []string{"Account", "fk_users_account", "Pets", "fk_users_pets", "Company", "fk_users_company", "Team", "fk_users_team", "Languages", "fk_users_languages"}
    
    	for _, name := range names {
    		if !DB.Migrator().HasConstraint(&User{}, name) {
    			DB.Migrator().CreateConstraint(&User{}, name)
    		}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  10. schema/utils.go

    	settings := map[string]string{}
    	names := strings.Split(str, sep)
    
    	for i := 0; i < len(names); i++ {
    		j := i
    		if len(names[j]) > 0 {
    			for {
    				if names[j][len(names[j])-1] == '\\' {
    					i++
    					names[j] = names[j][0:len(names[j])-1] + sep + names[i]
    					names[i] = ""
    				} else {
    					break
    				}
    			}
    		}
    
    		values := strings.Split(names[j], ":")
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Aug 19 13:35:14 GMT 2023
    - 5.5K bytes
    - Viewed (0)
Back to top