Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 134 for stringa (0.25 sec)

  1. schema/index.go

    	for _, value := range strings.Split(field.Tag.Get("gorm"), ";") {
    		if value != "" {
    			v := strings.Split(value, ":")
    			k := strings.TrimSpace(strings.ToUpper(v[0]))
    			if k == "INDEX" || k == "UNIQUEINDEX" {
    				var (
    					name       string
    					tag        = strings.Join(v[1:], ":")
    					idx        = strings.Index(tag, ",")
    					tagSetting = strings.Join(strings.Split(tag, ",")[1:], ",")
    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)
  2. schema/utils.go

    package schema
    
    import (
    	"context"
    	"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 {
    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)
  3. 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)
  4. 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)
  5. tests/scan_test.go

    	}
    
    	type Result struct {
    		Name string
    		Age  int
    	}
    
    	var results []Result
    	for rows.Next() {
    		var result Result
    		if err := DB.ScanRows(rows, &result); err != nil {
    			t.Errorf("should get no error, but got %v", err)
    		}
    		results = append(results, result)
    	}
    
    	sort.Slice(results, func(i, j int) bool {
    		return strings.Compare(results[i].Name, results[j].Name) <= -1
    	})
    
    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. tests/helper_test.go

    		}
    
    		sort.Slice(user.Languages, func(i, j int) bool {
    			return strings.Compare(user.Languages[i].Code, user.Languages[j].Code) > 0
    		})
    
    		sort.Slice(expect.Languages, func(i, j int) bool {
    			return strings.Compare(expect.Languages[i].Code, expect.Languages[j].Code) > 0
    		})
    		for idx, language := range user.Languages {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 8K bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top