Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for Model (0.13 sec)

  1. chainable_api.go

    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/utils"
    )
    
    // Model specify the model you would like to run db operations
    //
    //	// update all users's name to `hello`
    //	db.Model(&User{}).Update("name", "hello")
    //	// if user's primary key is non-blank, will use it as condition, then will only update that user's name to `hello`
    //	db.Model(&user).Update("name", "hello")
    func (db *DB) Model(value interface{}) (tx *DB) {
    	tx = db.getInstance()
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  2. schema/relationship_test.go

    	} else {
    		for _, rel := range relations {
    			checkSchemaRelation(t, s, rel)
    		}
    	}
    }
    
    func TestBelongsToOverrideForeignKey(t *testing.T) {
    	type Profile struct {
    		gorm.Model
    		Name string
    	}
    
    	type User struct {
    		gorm.Model
    		Profile      Profile `gorm:"ForeignKey:ProfileRefer"`
    		ProfileRefer int
    	}
    
    	checkStructRelation(t, &User{}, Relation{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  3. migrator/migrator.go

    //
    //	// CREATE VIEW `user_view` AS SELECT * FROM `users` WHERE age > 20
    //	q := DB.Model(&User{}).Where("age > ?", 20)
    //	DB.Debug().Migrator().CreateView("user_view", gorm.ViewOption{Query: q})
    //
    //	// CREATE OR REPLACE VIEW `users_view` AS SELECT * FROM `users` WITH CHECK OPTION
    //	q := DB.Model(&User{})
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  4. cmd/update.go

    			coreMap[cpus[i].CoreID] = struct{}{}
    		}
    		cpu := cpus[0]
    		uaAppend(" CPU ", fmt.Sprintf("(total_cpus:%d, total_cores:%d; vendor:%s; family:%s; model:%s; stepping:%d; model_name:%s)",
    			len(cpuMap), len(coreMap), cpu.VendorID, cpu.Family, cpu.Model, cpu.Stepping, cpu.ModelName))
    	}
    	uaAppend(")", "")
    
    	return strings.Join(userAgentParts, "")
    }
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed Apr 24 04:08:47 GMT 2024
    - 18.7K bytes
    - Viewed (0)
  5. istioctl/pkg/workload/workload.go

    	return meshConfig.DefaultConfig, os.WriteFile(filepath.Join(dir, "mesh.yaml"), proxyYAML, filePerms)
    }
    
    func marshalWorkloadEntryPodPorts(p map[string]uint32) string {
    	var out []model.PodPort
    	for name, port := range p {
    		out = append(out, model.PodPort{Name: name, ContainerPort: int(port)})
    	}
    	if len(out) == 0 {
    		return ""
    	}
    	sort.Slice(out, func(i, j int) bool {
    		return out[i].Name < out[j].Name
    	})
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Wed Apr 17 20:06:41 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  6. istioctl/pkg/proxyconfig/proxyconfig.go

    	"istio.io/istio/istioctl/pkg/writer/envoy/clusters"
    	"istio.io/istio/istioctl/pkg/writer/envoy/configdump"
    	"istio.io/istio/operator/pkg/util"
    	"istio.io/istio/pilot/pkg/model"
    	"istio.io/istio/pkg/config/host"
    	"istio.io/istio/pkg/kube"
    	"istio.io/istio/pkg/log"
    )
    
    const (
    	jsonOutput             = "json"
    	yamlOutput             = "yaml"
    	summaryOutput          = "short"
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Tue Apr 16 03:28:36 GMT 2024
    - 48K bytes
    - Viewed (0)
  7. tests/preload_test.go

    	}
    	wg.Wait()
    }
    
    func TestPreloadWithDiffModel(t *testing.T) {
    	user := *GetUser("preload_with_diff_model", Config{Account: true})
    
    	if err := DB.Create(&user).Error; err != nil {
    		t.Fatalf("errors happened when create: %v", err)
    	}
    
    	var result struct {
    		Something string
    		User
    	}
    
    	DB.Model(User{}).Preload("Account", clause.Eq{Column: "number", Value: user.Account.Number}).Select(
    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)
  8. schema/field.go

    	Float  DataType = "float"
    	String DataType = "string"
    	Time   DataType = "time"
    	Bytes  DataType = "bytes"
    )
    
    const DefaultAutoIncrementIncrement int64 = 1
    
    // Field is the representation of model schema's field
    type Field struct {
    	Name                   string
    	DBName                 string
    	BindNames              []string
    	EmbeddedBindNames      []string
    	DataType               DataType
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  9. istioctl/pkg/waypoint/waypoint.go

    	"k8s.io/apimachinery/pkg/types"
    	gateway "sigs.k8s.io/gateway-api/apis/v1"
    	"sigs.k8s.io/yaml"
    
    	"istio.io/api/label"
    	"istio.io/istio/istioctl/pkg/cli"
    	"istio.io/istio/pilot/pkg/model/kstatus"
    	"istio.io/istio/pkg/config/constants"
    	"istio.io/istio/pkg/config/protocol"
    	"istio.io/istio/pkg/config/schema/gvk"
    	"istio.io/istio/pkg/kube"
    	"istio.io/istio/pkg/slices"
    	"istio.io/istio/pkg/util/sets"
    )
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Wed May 08 19:45:58 GMT 2024
    - 15.5K bytes
    - Viewed (0)
  10. cmd/data-scanner.go

    			objectInfos = append(objectInfos, obj)
    			continue
    		}
    
    		toDel = append(toDel, ObjectToDelete{
    			ObjectV: ObjectV{
    				ObjectName: obj.Name,
    				VersionID:  obj.VersionID,
    			},
    		})
    	}
    
    	if len(toDel) > 0 {
    		expState.enqueueByNewerNoncurrent(i.bucket, toDel, event)
    	}
    	return objectInfos, nil
    }
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri May 03 11:18:58 GMT 2024
    - 47.6K bytes
    - Viewed (0)
Back to top