Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 135 for Spring (0.4 sec)

  1. tests/scanner_valuer_test.go

    	case []byte:
    		n, _ := strconv.Atoi(string(s))
    		*i = Num(n)
    	case int64:
    		*i = Num(s)
    	default:
    		return errors.New("Cannot scan NamedInt from " + reflect.ValueOf(src).String())
    	}
    	return nil
    }
    
    type StringsSlice []string
    
    func (l StringsSlice) Value() (driver.Value, error) {
    	bytes, err := json.Marshal(l)
    	return string(bytes), err
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  2. schema/index_test.go

    	MemberNumber string `gorm:"index:idx_id,priority:1"`
    	Name7        string `gorm:"index:type"`
    	Name8        string `gorm:"index:,length:10;index:,collate:utf8"`
    
    	// Composite Index: Flattened structure.
    	Data0A string `gorm:"index:,composite:comp_id0"`
    	Data0B string `gorm:"index:,composite:comp_id0"`
    
    	// Composite Index: Nested structure.
    	Data1A string `gorm:"index:,composite:comp_id1"`
    	CompIdxLevel1C
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 8K bytes
    - Viewed (0)
  3. schema/utils.go

    	"fmt"
    	"reflect"
    	"regexp"
    	"strings"
    
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/utils"
    )
    
    var embeddedCacheKey = "embedded_cache_store"
    
    func ParseTagSetting(str string, sep string) map[string]string {
    	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++
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Aug 19 13:35:14 GMT 2023
    - 5.5K bytes
    - Viewed (0)
  4. schema/index.go

    	"strings"
    )
    
    type Index struct {
    	Name    string
    	Class   string // UNIQUE | FULLTEXT | SPATIAL
    	Type    string // btree, hash, gist, spgist, gin, and brin
    	Where   string
    	Comment string
    	Option  string        // WITH PARSER parser_name
    	Fields  []IndexOption // Note: IndexOption's Field maybe the same
    }
    
    type IndexOption struct {
    	*Field
    	Expression string
    	Sort       string // DESC, ASC
    	Collate    string
    	Length     int
    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)
  5. prepare_stmt.go

    	prepareErr  error
    }
    
    type PreparedStmtDB struct {
    	Stmts       map[string]*Stmt
    	PreparedSQL []string
    	Mux         *sync.RWMutex
    	ConnPool
    }
    
    func NewPreparedStmtDB(connPool ConnPool) *PreparedStmtDB {
    	return &PreparedStmtDB{
    		ConnPool:    connPool,
    		Stmts:       make(map[string]*Stmt),
    		Mux:         &sync.RWMutex{},
    		PreparedSQL: make([]string, 0, 100),
    	}
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 28 08:47:39 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  6. tests/update_test.go

    		t.Fatalf("invalid updating SQL, got %v", stmt.SQL.String())
    	}
    
    	dryDB = DB.Session(&gorm.Session{DryRun: true})
    	stmt = dryDB.Unscoped().Save(&user).Statement
    	if !regexp.MustCompile(`WHERE .id. = [^ ]+$`).MatchString(stmt.SQL.String()) {
    		t.Fatalf("invalid updating SQL, got %v", stmt.SQL.String())
    	}
    
    	user3 := *GetUser("save3", Config{})
    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)
  7. schema/callbacks_test.go

    	if err != nil {
    		t.Fatalf("failed to parse user with callback, got error %v", err)
    	}
    
    	for _, str := range []string{"BeforeSave", "AfterCreate"} {
    		if !reflect.Indirect(reflect.ValueOf(user)).FieldByName(str).Interface().(bool) {
    			t.Errorf("%v should be true", str)
    		}
    	}
    
    	for _, str := range []string{"BeforeCreate", "BeforeUpdate", "AfterUpdate", "AfterSave", "BeforeDelete", "AfterDelete", "AfterFind"} {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 939 bytes
    - Viewed (0)
  8. clause/from_test.go

    package clause_test
    
    import (
    	"fmt"
    	"testing"
    
    	"gorm.io/gorm/clause"
    )
    
    func TestFrom(t *testing.T) {
    	results := []struct {
    		Clauses []clause.Interface
    		Result  string
    		Vars    []interface{}
    	}{
    		{
    			[]clause.Interface{clause.Select{}, clause.From{}},
    			"SELECT * FROM `users`", nil,
    		},
    		{
    			[]clause.Interface{
    				clause.Select{}, clause.From{
    					Tables: []clause.Table{{Name: "users"}},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Jul 15 02:25:10 GMT 2020
    - 1.9K bytes
    - Viewed (0)
  9. tests/scan_test.go

    	user1 := User{Name: "ScanUser1", Age: 1}
    	user2 := User{Name: "ScanUser2", Age: 10}
    	user3 := User{Name: "ScanUser3", Age: 20}
    	DB.Save(&user1).Save(&user2).Save(&user3)
    
    	type result struct {
    		ID   uint
    		Name string
    		Age  int
    	}
    
    	var res result
    	DB.Table("users").Select("id, name, age").Where("id = ?", user3.ID).Scan(&res)
    	if res.ID != user3.ID || res.Name != user3.Name || res.Age != int(user3.Age) {
    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)
  10. clause/select.go

    package clause
    
    // Select select attrs when querying, updating, creating
    type Select struct {
    	Distinct   bool
    	Columns    []Column
    	Expression Expression
    }
    
    func (s Select) Name() string {
    	return "SELECT"
    }
    
    func (s Select) Build(builder Builder) {
    	if len(s.Columns) > 0 {
    		if s.Distinct {
    			builder.WriteString("DISTINCT ")
    		}
    
    		for idx, column := range s.Columns {
    			if idx > 0 {
    				builder.WriteByte(',')
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Jul 14 07:51:24 GMT 2021
    - 1.1K bytes
    - Viewed (0)
Back to top