Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 29 for type (0.14 sec)

  1. migrator/migrator.go

    // TODO:? Create const vars for raw sql queries ?
    
    var _ gorm.Migrator = (*Migrator)(nil)
    
    // Migrator m struct
    type Migrator struct {
    	Config
    }
    
    // Config schema config
    type Config struct {
    	CreateIndexAfterCreateTable bool
    	DB                          *gorm.DB
    	gorm.Dialector
    }
    
    type printSQLLogger struct {
    	logger.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)
  2. callbacks/query.go

    			queryFields := db.QueryFields
    			if !queryFields {
    				switch db.Statement.ReflectValue.Kind() {
    				case reflect.Struct:
    					queryFields = db.Statement.ReflectValue.Type() != db.Statement.Schema.ModelType
    				case reflect.Slice:
    					queryFields = db.Statement.ReflectValue.Type().Elem() != db.Statement.Schema.ModelType
    				}
    			}
    
    			if queryFields {
    				stmt := gorm.Statement{DB: db}
    				// smaller struct
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Jan 29 03:34:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  3. tests/hooks_test.go

    			t.Errorf("invalid price for product #%v, expects: %v, got %v", idx, value, products2[idx].Price)
    		}
    	}
    }
    
    type Product4 struct {
    	gorm.Model
    	Name  string
    	Code  string
    	Price int64
    	Owner string
    	Item  ProductItem
    }
    
    type ProductItem struct {
    	gorm.Model
    	Code               string
    	Product4ID         uint
    	AfterFindCallTimes int
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 15.9K bytes
    - Viewed (0)
  4. chainable_api.go

    func (db *DB) Select(query interface{}, args ...interface{}) (tx *DB) {
    	tx = db.getInstance()
    
    	switch v := query.(type) {
    	case []string:
    		tx.Statement.Selects = v
    
    		for _, arg := range args {
    			switch arg := arg.(type) {
    			case string:
    				tx.Statement.Selects = append(tx.Statement.Selects, arg)
    			case []string:
    				tx.Statement.Selects = append(tx.Statement.Selects, arg...)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  5. tests/upsert_test.go

    	if err := DB.Find(&result, "code = ?", lang.Code).Error; err != nil || result.Name != lang.Name {
    		t.Fatalf("failed to upsert, got name %v", result.Name)
    	}
    
    	if name := DB.Dialector.Name(); name != "sqlserver" {
    		type RestrictedLanguage struct {
    			Code string `gorm:"primarykey"`
    			Name string
    			Lang string `gorm:"<-:create"`
    		}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Sep 05 07:39:19 GMT 2022
    - 11.4K bytes
    - Viewed (0)
  6. tests/preload_suits_test.go

    		t.Errorf("got %s; want %s", toJSONString(got), toJSONString(want))
    	}
    }
    
    type LevelA1 struct {
    	ID    uint
    	Value string
    }
    
    type LevelA2 struct {
    	ID       uint
    	Value    string
    	LevelA3s []*LevelA3 `json:",omitempty"`
    }
    
    type LevelA3 struct {
    	ID        uint
    	Value     string
    	LevelA1ID sql.NullInt64
    	LevelA1   *LevelA1
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Mar 18 05:38:46 GMT 2022
    - 30.3K bytes
    - Viewed (0)
  7. tests/table_test.go

    package tests_test
    
    import (
    	"regexp"
    	"sync"
    	"testing"
    
    	"gorm.io/driver/postgres"
    	"gorm.io/gorm"
    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils/tests"
    	. "gorm.io/gorm/utils/tests"
    )
    
    type UserWithTable struct {
    	gorm.Model
    	Name string
    }
    
    func (UserWithTable) TableName() string {
    	return "gorm.user"
    }
    
    func TestTable(t *testing.T) {
    	dryDB := DB.Session(&gorm.Session{DryRun: true})
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Mar 09 09:31:28 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  8. finisher_api.go

    	return tx
    }
    
    func (db *DB) assignInterfacesToValue(values ...interface{}) {
    	for _, value := range values {
    		switch v := value.(type) {
    		case []clause.Expression:
    			for _, expr := range v {
    				if eq, ok := expr.(clause.Eq); ok {
    					switch column := eq.Column.(type) {
    					case string:
    						if field := db.Statement.Schema.LookUpField(column); field != nil {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
  9. callbacks/create.go

    		// append @id column with value for auto-increment primary key
    		// the @id value is correct, when: 1. without setting auto-increment primary key, 2. database AutoIncrementIncrement = 1
    		switch values := db.Statement.Dest.(type) {
    		case map[string]interface{}:
    			values[pkFieldName] = insertID
    		case *map[string]interface{}:
    			(*values)[pkFieldName] = insertID
    		case []map[string]interface{}, *[]map[string]interface{}:
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 08 03:29:55 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  10. tests/scanner_valuer_test.go

    	return append([]byte("***"), data...), nil
    }
    
    type Num int64
    
    func (i *Num) Scan(src interface{}) error {
    	switch s := src.(type) {
    	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
    
    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)
Back to top