Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 21 for Model (0.16 sec)

  1. tests/query_test.go

    	var simpleUser2 SimpleUser
    	if err := DB.Model(&User{}).Select("id").First(&simpleUser2, user.ID).Error; err != nil {
    		t.Fatalf("Failed to query smaller user, got error %v", err)
    	}
    
    	AssertObjEqual(t, user, simpleUser2, "ID")
    
    	var simpleUsers []SimpleUser
    	if err := DB.Model(&User{}).Select("id").Find(&simpleUsers, user.ID).Error; err != nil || len(simpleUsers) != 1 {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
  2. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  3. cmd/iam-etcd-store.go

    	//  a large number of policies
    	r, err := ies.client.Get(ctx, iamConfigPoliciesPrefix, etcd.WithPrefix())
    	if err != nil {
    		return err
    	}
    
    	// Parse all values to construct the policies data model.
    	for _, kvs := range r.Kvs {
    		if err = ies.getPolicyDocKV(ctx, kvs, m); err != nil && !errors.Is(err, errNoSuchPolicy) {
    			return err
    		}
    	}
    	return nil
    }
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 13.6K bytes
    - Viewed (0)
  4. tests/default_value_test.go

    package tests_test
    
    import (
    	"testing"
    	"time"
    
    	"gorm.io/gorm"
    )
    
    func TestDefaultValue(t *testing.T) {
    	type Harumph struct {
    		gorm.Model
    		Email   string    `gorm:"not null;index:,unique"`
    		Name    string    `gorm:"notNull;default:foo"`
    		Name2   string    `gorm:"size:233;not null;default:'foo'"`
    		Name3   string    `gorm:"size:233;notNull;default:''"`
    		Age     int       `gorm:"default:18"`
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 08 03:29:55 GMT 2024
    - 2.3K bytes
    - Viewed (0)
  5. istioctl/pkg/metrics/metrics.go

    	"strings"
    	"text/tabwriter"
    	"time"
    
    	"github.com/hashicorp/go-multierror"
    	"github.com/prometheus/client_golang/api"
    	promv1 "github.com/prometheus/client_golang/api/prometheus/v1"
    	"github.com/prometheus/common/model"
    	"github.com/spf13/cobra"
    
    	"istio.io/istio/istioctl/pkg/cli"
    	"istio.io/istio/istioctl/pkg/clioptions"
    	"istio.io/istio/istioctl/pkg/completion"
    	"istio.io/istio/istioctl/pkg/dashboard"
    	"istio.io/istio/pkg/log"
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Sat Apr 13 05:23:38 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  6. istioctl/pkg/waypoint/waypoint_test.go

    	"os"
    	"strings"
    	"testing"
    
    	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    	gateway "sigs.k8s.io/gateway-api/apis/v1"
    
    	"istio.io/api/label"
    	"istio.io/istio/istioctl/pkg/cli"
    	"istio.io/istio/pilot/pkg/model/kstatus"
    	"istio.io/istio/pkg/config/constants"
    )
    
    func TestWaypointList(t *testing.T) {
    	cases := []struct {
    		name            string
    		args            []string
    		gateways        []*gateway.Gateway
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Thu Apr 04 15:53:09 GMT 2024
    - 4.4K bytes
    - Viewed (0)
  7. errors.go

    	// ErrPrimaryKeyRequired primary keys required
    	ErrPrimaryKeyRequired = errors.New("primary key required")
    	// ErrModelValueRequired model value required
    	ErrModelValueRequired = errors.New("model value required")
    	// ErrModelAccessibleFieldsRequired model accessible fields required
    	ErrModelAccessibleFieldsRequired = errors.New("model accessible fields required")
    	// ErrSubQueryRequired sub query required
    	ErrSubQueryRequired = errors.New("sub query required")
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 02:53:17 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  8. istioctl/pkg/describe/describe.go

    	"istio.io/istio/istioctl/pkg/util/handlers"
    	istio_envoy_configdump "istio.io/istio/istioctl/pkg/writer/envoy/configdump"
    	"istio.io/istio/pilot/pkg/config/kube/crdclient"
    	"istio.io/istio/pilot/pkg/model"
    	"istio.io/istio/pilot/pkg/networking/util"
    	"istio.io/istio/pilot/pkg/security/authn"
    	pilotcontroller "istio.io/istio/pilot/pkg/serviceregistry/kube/controller"
    	v3 "istio.io/istio/pilot/pkg/xds/v3"
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Sat Apr 13 05:23:38 GMT 2024
    - 50.4K bytes
    - Viewed (0)
  9. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  10. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 14.9K bytes
    - Viewed (0)
Back to top