Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 29 of 29 for jinzhu (0.14 sec)

  1. 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"`
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 8K bytes
    - Viewed (0)
  2. tests/update_test.go

    	} else {
    		CheckUser(t, result4, *user)
    	}
    
    	if rowsAffected := DB.Model([]User{result4}).Where("age > 0").Update("name", "jinzhu").RowsAffected; rowsAffected != 1 {
    		t.Errorf("should only update one record, but got %v", rowsAffected)
    	}
    
    	if rowsAffected := DB.Model(users).Where("age > 0").Update("name", "jinzhu").RowsAffected; rowsAffected != 3 {
    		t.Errorf("should only update one record, but got %v", rowsAffected)
    	}
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  3. tests/serializer_test.go

    	}
    
    	createdAt := time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC)
    	updatedAt := createdAt.Unix()
    
    	data := SerializerStruct{
    		Name:            []byte("jinzhu"),
    		Roles:           []string{"r1", "r2"},
    		Contracts:       map[string]interface{}{"name": "jinzhu", "age": 10},
    		EncryptedString: EncryptedString("pass"),
    		CreatedTime:     createdAt.Unix(),
    		UpdatedTime:     &updatedAt,
    		JobInfo: Job{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 21 14:09:38 GMT 2023
    - 7.6K bytes
    - Viewed (0)
  4. 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)
  5. tests/sql_builder_test.go

    	}
    
    	DB.Exec("update users set name=? where name in (?)", "jinzhu-raw", []string{user1.Name, user2.Name, user3.Name})
    	if DB.Where("name in (?)", []string{user1.Name, user2.Name, user3.Name}).First(&User{}).Error != gorm.ErrRecordNotFound {
    		t.Error("Raw sql to update records")
    	}
    
    	DB.Exec("update users set age=? where name = ?", gorm.Expr("age * ? + ?", 2, 10), "jinzhu-raw")
    
    	var age int
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
  6. statement.go

    		newStmt.Settings.Store(k, v)
    		return true
    	})
    
    	return newStmt
    }
    
    // SetColumn set column's value
    //
    //	stmt.SetColumn("Name", "jinzhu") // Hooks Method
    //	stmt.SetColumn("Name", "jinzhu", true) // Callbacks Method
    func (stmt *Statement) SetColumn(name string, value interface{}, fromCallbacks ...bool) {
    	if v, ok := stmt.Dest.(map[string]interface{}); ok {
    		v[name] = value
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
  7. tests/associations_test.go

    	}
    	DB.Migrator().DropTable(&AssociationEmptyUser{}, &AssociationEmptyPet{})
    	DB.AutoMigrate(&AssociationEmptyUser{}, &AssociationEmptyPet{})
    
    	id := uint(100)
    	user := AssociationEmptyUser{
    		ID:   id,
    		Name: "jinzhu",
    		Pets: []AssociationEmptyPet{
    			{AssociationEmptyUserID: &id, Name: "bar"},
    			{AssociationEmptyUserID: &id, Name: "foo"},
    		},
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Feb 08 08:29:09 GMT 2023
    - 10.9K 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)
Back to top