Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 81 for Model (0.14 sec)

  1. tests/soft_delete_test.go

    	user := *GetUser("SoftDelete", Config{})
    	DB.Save(&user)
    
    	var count int64
    	var age uint
    
    	if DB.Model(&User{}).Where("name = ?", user.Name).Count(&count).Error != nil || count != 1 {
    		t.Errorf("Count soft deleted record, expects: %v, got: %v", 1, count)
    	}
    
    	if DB.Model(&User{}).Select("age").Where("name = ?", user.Name).Scan(&age).Error != nil || age != user.Age {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Feb 01 06:40:55 GMT 2023
    - 5.7K bytes
    - Viewed (0)
  2. 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 Apr 24 22:53:08 GMT 2024
    - Last Modified: Tue Apr 16 03:28:36 GMT 2024
    - 48K bytes
    - Viewed (0)
  3. cni/pkg/install/kubeconfig.go

    	}
    
    	protocol := model.GetOrDefault(cfg.K8sServiceProtocol, "https")
    	cluster := &api.Cluster{
    		Server: fmt.Sprintf("%s://%s", protocol, net.JoinHostPort(cfg.K8sServiceHost, cfg.K8sServicePort)),
    	}
    
    	if cfg.SkipTLSVerify {
    		// User explicitly opted into insecure.
    		cluster.InsecureSkipTLSVerify = true
    	} else {
    		caFile := model.GetOrDefault(cfg.KubeCAFile, constants.ServiceAccountPath+"/ca.crt")
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Aug 11 01:19:03 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  4. finisher_api.go

    	tx.Logger = currentLogger
    	return
    }
    
    // Pluck queries a single column from a model, returning in the slice dest. E.g.:
    //
    //	var ages []int64
    //	db.Model(&users).Pluck("age", &ages)
    func (db *DB) Pluck(column string, dest interface{}) (tx *DB) {
    	tx = db.getInstance()
    	if tx.Statement.Model != nil {
    		if tx.Statement.Parse(tx.Statement.Model) == nil {
    			if f := tx.Statement.Schema.LookUpField(column); f != 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)
  5. tests/count_test.go

    	})
    
    	var count1 int64
    	if err := DB.Model(&Company{}).Where("name = ?", "company_count_group_a").Group("name").Count(&count1).Error; err != nil {
    		t.Errorf(fmt.Sprintf("Count should work, but got err %v", err))
    	}
    	if count1 != 1 {
    		t.Errorf("Count with group should be 1, but got count: %v", count1)
    	}
    
    	var count2 int64
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 6.9K bytes
    - Viewed (0)
  6. tests/joins_test.go

    	if db5.Error != nil {
    		t.Errorf("Should not raise error for join where identical fields in different tables. Error: %s", db5.Error.Error())
    	}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Apr 26 14:19:32 GMT 2023
    - 13.5K bytes
    - Viewed (1)
  7. tests/migrate_test.go

    	}
    }
    
    func TestMigrateTable(t *testing.T) {
    	type TableStruct struct {
    		gorm.Model
    		Name string
    	}
    
    	DB.Migrator().DropTable(&TableStruct{})
    	DB.AutoMigrate(&TableStruct{})
    
    	if !DB.Migrator().HasTable(&TableStruct{}) {
    		t.Fatalf("should found created table")
    	}
    
    	type NewTableStruct struct {
    		gorm.Model
    		Name string
    	}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  8. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  9. callbacks.go

    		optimizer.ModifyStatement(stmt)
    	}
    
    	// assign model values
    	if stmt.Model == nil {
    		stmt.Model = stmt.Dest
    	} else if stmt.Dest == nil {
    		stmt.Dest = stmt.Model
    	}
    
    	// parse model values
    	if stmt.Model != nil {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 8.6K bytes
    - Viewed (1)
  10. tests/transaction_test.go

    func TestTransactionWithHooks(t *testing.T) {
    	user := GetUser("tTestTransactionWithHooks", Config{Account: true})
    	DB.Create(&user)
    
    	var err error
    	err = DB.Transaction(func(tx *gorm.DB) error {
    		return tx.Model(&User{}).Limit(1).Transaction(func(tx2 *gorm.DB) error {
    			return tx2.Scan(&User{}).Error
    		})
    	})
    
    	if err != nil {
    		t.Error(err)
    	}
    
    	// method with hooks
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 10.9K bytes
    - Viewed (0)
Back to top