Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 81 for Model (0.14 sec)

  1. tests/postgres_test.go

    		t.Errorf("No error should happen, but got %v", err)
    	}
    }
    
    func TestPostgres(t *testing.T) {
    	if DB.Dialector.Name() != "postgres" {
    		t.Skip()
    	}
    
    	type Harumph struct {
    		gorm.Model
    		Name      string         `gorm:"check:name_checker,name <> ''"`
    		Test      uuid.UUID      `gorm:"type:uuid;not null;default:gen_random_uuid()"`
    		CreatedAt time.Time      `gorm:"type:TIMESTAMP WITHOUT TIME ZONE"`
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Oct 08 09:16:32 GMT 2022
    - 6.4K bytes
    - Viewed (3)
  2. istioctl/pkg/xds/client.go

    	discovery "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3"
    	"google.golang.org/grpc"
    	"google.golang.org/grpc/credentials"
    
    	"istio.io/istio/istioctl/pkg/clioptions"
    	"istio.io/istio/pilot/pkg/model"
    	"istio.io/istio/pkg/adsc"
    	"istio.io/istio/pkg/kube"
    )
    
    const (
    	// defaultExpirationSeconds is how long-lived a token to request (an hour)
    	defaultExpirationSeconds = 60 * 60
    )
    
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Tue Dec 19 22:42:42 GMT 2023
    - 3.7K bytes
    - Viewed (0)
  3. tests/update_has_one_test.go

    		CheckPet(t, pet4, pet)
    	})
    
    	t.Run("Restriction", func(t *testing.T) {
    		type CustomizeAccount struct {
    			gorm.Model
    			UserID  sql.NullInt64
    			Number  string `gorm:"<-:create"`
    			Number2 string
    		}
    
    		type CustomizeUser struct {
    			gorm.Model
    			Name    string
    			Account CustomizeAccount `gorm:"foreignkey:UserID"`
    		}
    
    		DB.Migrator().DropTable(&CustomizeUser{})
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jul 14 06:55:54 GMT 2022
    - 3.6K bytes
    - Viewed (0)
  4. 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 May 08 22:53:08 GMT 2024
    - Last Modified: Fri Aug 11 01:19:03 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  5. 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 May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
  6. tests/create_test.go

    				t.Fatalf("errors happened when query: %v", err)
    			} else {
    				CheckUser(t, newUser, user)
    			}
    		}
    	}
    }
    
    func TestCreateFromMap(t *testing.T) {
    	if err := DB.Model(&User{}).Create(map[string]interface{}{"Name": "create_from_map", "Age": 18}).Error; err != nil {
    		t.Fatalf("failed to create data from map, got error: %v", err)
    	}
    
    	var result User
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
  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 May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  8. 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 May 08 22:53:08 GMT 2024
    - Last Modified: Thu Apr 04 15:53:09 GMT 2024
    - 4.4K bytes
    - Viewed (0)
  9. istioctl/pkg/writer/pilot/status.go

    	discovery "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3"
    	xdsstatus "github.com/envoyproxy/go-control-plane/envoy/service/status/v3"
    
    	"istio.io/istio/istioctl/pkg/multixds"
    	"istio.io/istio/pilot/pkg/model"
    	xdsresource "istio.io/istio/pilot/pkg/xds/v3"
    	"istio.io/istio/pkg/log"
    )
    
    // XdsStatusWriter enables printing of sync status using multiple xdsapi.DiscoveryResponse Istiod responses
    type XdsStatusWriter struct {
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Fri Mar 15 04:16:55 GMT 2024
    - 6.1K bytes
    - Viewed (0)
  10. tests/scopes_test.go

    			expected: `SELECT * FROM "languages" WHERE z = 0 AND a = 1 OR (b = 2 OR c = 3)`,
    		}, {
    			name: "depth_2",
    			queryFn: func(tx *gorm.DB) *gorm.DB {
    				return tx.Scopes(
    					func(d *gorm.DB) *gorm.DB { return d.Model(&Language{}) },
    					func(d *gorm.DB) *gorm.DB {
    						return d.
    							Or(DB.Scopes(
    								func(d *gorm.DB) *gorm.DB { return d.Where("a = 1") },
    								func(d *gorm.DB) *gorm.DB { return d.Where("b = 2") },
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 3.3K bytes
    - Viewed (0)
Back to top