Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 21 for jinzhu1 (0.24 sec)

  1. tests/query_test.go

    	}
    
    	result = dryDB.Where("name = ?", "jinzhu").Or(User{Name: "jinzhu 2", Age: 18}).Find(&User{})
    	if !regexp.MustCompile("SELECT \\* FROM .*users.* WHERE .*name.* = .+ OR \\(.*name.* AND .*age.*\\)").MatchString(result.Statement.SQL.String()) {
    		t.Fatalf("Build OR condition, but got %v", result.Statement.SQL.String())
    	}
    
    	result = dryDB.Where("name = ?", "jinzhu").Or(map[string]interface{}{"name": "jinzhu 2", "age": 18}).Find(&User{})
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed May 08 04:07:58 UTC 2024
    - 49.8K bytes
    - Viewed (0)
  2. schema/constraint_test.go

    import (
    	"reflect"
    	"sync"
    	"testing"
    
    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils/tests"
    )
    
    type UserCheck struct {
    	Name  string `gorm:"check:name_checker,name <> 'jinzhu'"`
    	Name2 string `gorm:"check:name <> 'jinzhu'"`
    	Name3 string `gorm:"check:,name <> 'jinzhu'"`
    }
    
    func TestParseCheck(t *testing.T) {
    	user, err := schema.Parse(&UserCheck{}, &sync.Map{}, schema.NamingStrategy{})
    	if err != nil {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sun Feb 04 07:49:19 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  3. go.sum

    github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
    github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
    github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
    github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
    golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 03:46:59 UTC 2024
    - 491 bytes
    - Viewed (0)
  4. chainable_api.go

    //
    //	// Find the first user with name jinzhu
    //	db.Where("name = ?", "jinzhu").First(&user)
    //	// Find the first user with name jinzhu and age 20
    //	db.Where(&User{Name: "jinzhu", Age: 20}).First(&user)
    //	// Find the first user with name jinzhu and age not equal to 20
    //	db.Where("name = ?", "jinzhu").Where("age <> ?", "20").First(&user)
    //
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 09:47:34 UTC 2024
    - 14.5K bytes
    - Viewed (0)
  5. logger/sql_test.go

    			NumericRegexp: nil,
    			Vars:          []interface{}{"jinzhu", 1, 999.99, true, []byte("12345"), tt, &tt, nil, "w@g.\"com", myrole, pwd},
    			Result:        `create table users (name, age, height, actived, bytes, create_at, update_at, deleted_at, email, role, pass) values ("jinzhu", 1, 999.99, true, "12345", "2020-02-23 11:10:10", "2020-02-23 11:10:10", NULL, "w@g.""com", "admin", "pass")`,
    		},
    		{
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Mar 21 08:00:02 UTC 2024
    - 8.4K bytes
    - Viewed (0)
  6. clause/where_test.go

    			}},
    			"SELECT * FROM `users` WHERE `users`.`id` = ? AND `age` > ? OR `name` <> ?",
    			[]interface{}{"1", 18, "jinzhu"},
    		},
    		{
    			[]clause.Interface{clause.Select{}, clause.From{}, clause.Where{
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Apr 25 12:22:53 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  7. go.mod

    module gorm.io/gorm
    
    go 1.18
    
    require (
    	github.com/jinzhu/inflection v1.0.0
    	github.com/jinzhu/now v1.1.5
    	golang.org/x/text v0.14.0
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 03:46:59 UTC 2024
    - 136 bytes
    - Viewed (0)
  8. tests/go.mod

    module gorm.io/gorm/tests
    
    go 1.18
    
    require (
    	github.com/google/uuid v1.6.0
    	github.com/jinzhu/now v1.1.5
    	github.com/lib/pq v1.10.9
    	github.com/stretchr/testify v1.9.0
    	gorm.io/driver/mysql v1.5.7
    	gorm.io/driver/postgres v1.5.9
    	gorm.io/driver/sqlite v1.5.6
    	gorm.io/driver/sqlserver v1.5.3
    	gorm.io/gorm v1.25.10
    )
    
    require (
    	filippo.io/edwards25519 v1.1.0 // indirect
    	github.com/davecgh/go-spew v1.1.1 // indirect
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 09:24:34 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  9. tests/prepared_stmt_test.go

    	sqlDB, _ := tx.DB()
    	sqlDB.SetMaxOpenConns(1)
    
    	tx = tx.Session(&gorm.Session{PrepareStmt: true})
    
    	wg := sync.WaitGroup{}
    	for i := 0; i < 100; i++ {
    		wg.Add(1)
    		go func() {
    			user := User{Name: "jinzhu"}
    			tx.Create(&user)
    
    			var result User
    			tx.First(&result)
    			wg.Done()
    		}()
    	}
    	wg.Wait()
    
    	conn, ok := tx.ConnPool.(*gorm.PreparedStmtDB)
    	AssertEqual(t, ok, true)
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Mar 21 07:55:43 UTC 2024
    - 4K bytes
    - Viewed (0)
  10. schema/index_test.go

    )
    
    type UserIndex struct {
    	Name         string `gorm:"index"`
    	Name2        string `gorm:"index:idx_name,unique"`
    	Name3        string `gorm:"index:,sort:desc,collate:utf8,type:btree,length:10,where:name3 != 'jinzhu'"`
    	Name4        string `gorm:"uniqueIndex"`
    	Name5        int64  `gorm:"index:,class:FULLTEXT,comment:hello \\, world,where:age > 10"`
    	Name6        int64  `gorm:"index:profile,comment:hello \\, world,where:age > 10"`
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sun Feb 04 07:49:19 UTC 2024
    - 8K bytes
    - Viewed (0)
Back to top