Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for jinzhu2 (2.89 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{})
    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)
  2. 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")`,
    		},
    		{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  3. 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)
    //
    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)
  4. 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{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  5. 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)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 07:55:43 GMT 2024
    - 4K bytes
    - Viewed (0)
  6. tests/preload_test.go

    					{Name: "Alexis Tool 2"},
    				},
    			},
    		},
    		{
    			Name: "TestMergeNestedPreloadWithNestedJoin-2",
    			Manager: &User{
    				Name: "Jinzhu Manager",
    				Tools: []Tools{
    					{Name: "Jinzhu Tool 1"},
    					{Name: "Jinzhu Tool 2"},
    				},
    			},
    		},
    	}
    
    	DB.Create(&users)
    
    	query := make([]string, 0)
    	sess := DB.Session(&gorm.Session{Logger: Tracer{
    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)
  7. tests/create_test.go

    package tests_test
    
    import (
    	"errors"
    	"fmt"
    	"regexp"
    	"testing"
    	"time"
    
    	"github.com/jinzhu/now"
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    	. "gorm.io/gorm/utils/tests"
    )
    
    func TestCreate(t *testing.T) {
    	user := *GetUser("create", Config{})
    
    	if results := DB.Create(&user); results.Error != nil {
    		t.Fatalf("errors happened when create: %v", results.Error)
    	} else if results.RowsAffected != 1 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
  8. schema/relationship.go

    package schema
    
    import (
    	"context"
    	"fmt"
    	"reflect"
    	"strings"
    
    	"github.com/jinzhu/inflection"
    	"gorm.io/gorm/clause"
    )
    
    // RelationshipType relationship type
    type RelationshipType string
    
    const (
    	HasOne    RelationshipType = "has_one"      // HasOneRel has one relationship
    	HasMany   RelationshipType = "has_many"     // HasManyRel has many relationship
    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)
  9. schema/field.go

    package schema
    
    import (
    	"context"
    	"database/sql"
    	"database/sql/driver"
    	"fmt"
    	"reflect"
    	"strconv"
    	"strings"
    	"sync"
    	"time"
    
    	"github.com/jinzhu/now"
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/utils"
    )
    
    // special types' reflect type
    var (
    	TimeReflectType    = reflect.TypeOf(time.Time{})
    	TimePtrReflectType = reflect.TypeOf(&time.Time{})
    	ByteReflectType    = reflect.TypeOf(uint8(0))
    )
    
    type (
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  10. RELEASE.md

    GBLin5566, Greg Peatfield, Gu Wang, Guenther Schmuelling, Hans Pabst, Harun
    Gunaydin, Huaizheng, Ido Shamay, Ikaro Silva, Ilya Edrenkin, Immexxx, James
    Mishra, Jamie Cooke, Jay Young, Jayaram Bobba, Jianfei Wang, jinghua2, Joey
    Meyer, John Maidens, Jonghoon Jin, Julian Villella, Jun Kim, Jun Shi, Junwei
    Pan, jyegerlehner, Karan Desai, Karel Van De Plassche, Kb Sriram,
    Plain Text
    - Registered: Tue May 07 12:40:20 GMT 2024
    - Last Modified: Mon Apr 29 19:17:57 GMT 2024
    - 727.7K bytes
    - Viewed (8)
Back to top