Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 20 for sqrt (0.14 sec)

  1. tests/helper_test.go

    		if len(user.Pets) != len(expect.Pets) {
    			t.Fatalf("pets should equal, expect: %v, got %v", len(expect.Pets), len(user.Pets))
    		}
    
    		sort.Slice(user.Pets, func(i, j int) bool {
    			return user.Pets[i].ID > user.Pets[j].ID
    		})
    
    		sort.Slice(expect.Pets, func(i, j int) bool {
    			return expect.Pets[i].ID > expect.Pets[j].ID
    		})
    
    		for idx, pet := range user.Pets {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 8K bytes
    - Viewed (0)
  2. schema/index.go

    					Where:   settings["WHERE"],
    					Comment: settings["COMMENT"],
    					Option:  settings["OPTION"],
    					Fields: []IndexOption{{
    						Field:      field,
    						Expression: settings["EXPRESSION"],
    						Sort:       settings["SORT"],
    						Collate:    settings["COLLATE"],
    						Length:     length,
    						priority:   priority,
    					}},
    				})
    			}
    		}
    	}
    
    	err = nil
    	return
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  3. tests/update_test.go

    	result.Friends = append(user.Friends, result.Friends...)
    
    	sort.Slice(result.Pets, func(i, j int) bool {
    		return result.Pets[i].ID < result.Pets[j].ID
    	})
    	sort.Slice(result.Team, func(i, j int) bool {
    		return result.Team[i].ID < result.Team[j].ID
    	})
    	sort.Slice(result.Friends, func(i, j int) bool {
    		return result.Friends[i].ID < result.Friends[j].ID
    	})
    	sort.Slice(result2.Pets, func(i, j int) bool {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  4. schema/index_test.go

    	"testing"
    
    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils/tests"
    )
    
    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"`
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 8K bytes
    - Viewed (0)
  5. tests/scan_test.go

    package tests_test
    
    import (
    	"reflect"
    	"sort"
    	"strings"
    	"testing"
    
    	"gorm.io/gorm"
    	. "gorm.io/gorm/utils/tests"
    )
    
    type PersonAddressInfo struct {
    	Person  *Person  `gorm:"embedded"`
    	Address *Address `gorm:"embedded"`
    }
    
    func TestScan(t *testing.T) {
    	user1 := User{Name: "ScanUser1", Age: 1}
    	user2 := User{Name: "ScanUser2", Age: 10}
    	user3 := User{Name: "ScanUser3", Age: 20}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat May 28 14:18:07 GMT 2022
    - 8.2K bytes
    - Viewed (0)
  6. clause/set.go

    package clause
    
    import "sort"
    
    type Set []Assignment
    
    type Assignment struct {
    	Column Column
    	Value  interface{}
    }
    
    func (set Set) Name() string {
    	return "SET"
    }
    
    func (set Set) Build(builder Builder) {
    	if len(set) > 0 {
    		for idx, assignment := range set {
    			if idx > 0 {
    				builder.WriteByte(',')
    			}
    			builder.WriteQuoted(assignment.Column)
    			builder.WriteByte('=')
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Nov 29 03:02:44 GMT 2021
    - 1.4K bytes
    - Viewed (0)
  7. migrator/migrator.go

    			str = opt.Expression
    		} else if opt.Length > 0 {
    			str += fmt.Sprintf("(%d)", opt.Length)
    		}
    
    		if opt.Collate != "" {
    			str += " COLLATE " + opt.Collate
    		}
    
    		if opt.Sort != "" {
    			str += " " + opt.Sort
    		}
    		results = append(results, clause.Expr{SQL: str})
    	}
    	return
    }
    
    // BuildIndexOptionsInterface build index options interface
    type BuildIndexOptionsInterface interface {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  8. callbacks/helper.go

    package callbacks
    
    import (
    	"reflect"
    	"sort"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    )
    
    // ConvertMapToValuesForCreate convert map to values
    func ConvertMapToValuesForCreate(stmt *gorm.Statement, mapValue map[string]interface{}) (values clause.Values) {
    	values.Columns = make([]clause.Column, 0, len(mapValue))
    	selectColumns, restricted := stmt.SelectAndOmitColumns(true, false)
    
    	keys := make([]string, 0, len(mapValue))
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 14 12:32:57 GMT 2022
    - 3.7K bytes
    - Viewed (0)
  9. tests/preload_test.go

    package tests_test
    
    import (
    	"context"
    	"encoding/json"
    	"regexp"
    	"sort"
    	"strconv"
    	"sync"
    	"testing"
    	"time"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    	. "gorm.io/gorm/utils/tests"
    )
    
    func TestPreloadWithAssociations(t *testing.T) {
    	user := *GetUser("preload_with_associations", Config{
    		Account:   true,
    		Pets:      2,
    		Toys:      3,
    		Company:   true,
    		Manager:   true,
    		Team:      4,
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  10. callbacks/update.go

    package callbacks
    
    import (
    	"reflect"
    	"sort"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils"
    )
    
    func SetupUpdateReflectValue(db *gorm.DB) {
    	if db.Error == nil && db.Statement.Schema != nil {
    		if !db.Statement.ReflectValue.CanAddr() || db.Statement.Model != db.Statement.Dest {
    			db.Statement.ReflectValue = reflect.ValueOf(db.Statement.Model)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 05:44:55 GMT 2024
    - 9.4K bytes
    - Viewed (1)
Back to top