Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 67 for Pschera (0.28 sec)

  1. schema/schema.go

    	cacheStore                *sync.Map
    }
    
    func (schema Schema) String() string {
    	if schema.ModelType.Name() == "" {
    		return fmt.Sprintf("%s(%s)", schema.Name, schema.Table)
    	}
    	return fmt.Sprintf("%s.%s", schema.ModelType.PkgPath(), schema.ModelType.Name())
    }
    
    func (schema Schema) MakeSlice() reflect.Value {
    	slice := reflect.MakeSlice(reflect.SliceOf(reflect.PtrTo(schema.ModelType)), 0, 20)
    	results := reflect.New(slice.Type())
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Oct 10 06:50:29 GMT 2023
    - 13.7K bytes
    - Viewed (0)
  2. schema/schema_test.go

    	if err != nil {
    		t.Fatalf("failed to parse pointer user, got error %v", err)
    	}
    
    	checkUserSchema(t, user)
    }
    
    func checkUserSchema(t *testing.T, user *schema.Schema) {
    	// check schema
    	checkSchema(t, user, schema.Schema{Name: "User", Table: "users"}, []string{"ID"})
    
    	// check fields
    	fields := []schema.Field{
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  3. schema/relationship.go

    	}
    
    	if schema.err == nil {
    		schema.setRelation(relation)
    		switch relation.Type {
    		case HasOne:
    			schema.Relationships.HasOne = append(schema.Relationships.HasOne, relation)
    		case HasMany:
    			schema.Relationships.HasMany = append(schema.Relationships.HasMany, relation)
    		case BelongsTo:
    			schema.Relationships.BelongsTo = append(schema.Relationships.BelongsTo, relation)
    		case Many2Many:
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
  4. association.go

    			}
    		}
    
    		switch rel.Type {
    		case schema.BelongsTo:
    			associationDB := association.DB.Session(&Session{})
    			tx := associationDB.Model(reflect.New(rel.Schema.ModelType).Interface())
    
    			_, pvs := schema.GetIdentityFieldValuesMap(association.DB.Statement.Context, reflectValue, rel.Schema.PrimaryFields)
    			if pcolumn, pvalues := schema.ToQueryValues(rel.Schema.Table, rel.Schema.PrimaryFieldDBNames, pvs); len(pvalues) > 0 {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu May 04 11:30:45 GMT 2023
    - 21.2K bytes
    - Viewed (0)
  5. schema/constraint_test.go

    package schema_test
    
    import (
    	"reflect"
    	"sync"
    	"testing"
    
    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils/tests"
    )
    
    type UserCheck struct {
    	Name  string `gorm:"check:name_checker,name <> 'jinzhu'"`
    	Name2 string `gorm:"check:name <> 'jinzhu'"`
    	Name3 string `gorm:"check:,name <> 'jinzhu'"`
    }
    
    func TestParseCheck(t *testing.T) {
    	user, err := schema.Parse(&UserCheck{}, &sync.Map{}, schema.NamingStrategy{})
    	if err != nil {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 2.2K bytes
    - Viewed (0)
  6. istioctl/pkg/validate/validate.go

    // TODO(nmittler): Remove this once Pilot migrates to galley schema.
    func convertObjectFromUnstructured(schema resource.Schema, un *unstructured.Unstructured, domain string) (*config.Config, error) {
    	data, err := fromSchemaAndJSONMap(schema, un.Object["spec"])
    	if err != nil {
    		return nil, err
    	}
    
    	return &config.Config{
    		Meta: config.Meta{
    			GroupVersionKind:  schema.GroupVersionKind(),
    			Name:              un.GetName(),
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Mon Jan 22 17:58:52 GMT 2024
    - 15K bytes
    - Viewed (0)
  7. schema/field.go

    			cacheStore.Store(embeddedCacheKey, true)
    			if field.EmbeddedSchema, err = getOrParse(fieldValue.Interface(), cacheStore, embeddedNamer{Table: schema.Table, Namer: schema.namer}); err != nil {
    				schema.err = err
    			}
    
    			for _, ef := range field.EmbeddedSchema.Fields {
    				ef.Schema = schema
    				ef.OwnerSchema = field.EmbeddedSchema
    				ef.BindNames = append([]string{fieldStruct.Name}, ef.BindNames...)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  8. migrator/table_type.go

    )
    
    // TableType table type implements TableType interface
    type TableType struct {
    	SchemaValue  string
    	NameValue    string
    	TypeValue    string
    	CommentValue sql.NullString
    }
    
    // Schema returns the schema of the table.
    func (ct TableType) Schema() string {
    	return ct.SchemaValue
    }
    
    // Name returns the name of the table.
    func (ct TableType) Name() string {
    	return ct.NameValue
    }
    
    // Type returns the type of the table.
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri May 05 07:58:27 GMT 2023
    - 688 bytes
    - Viewed (0)
  9. gorm.go

    }
    
    // SetupJoinTable setup join table schema
    func (db *DB) SetupJoinTable(model interface{}, field string, joinTable interface{}) error {
    	var (
    		tx                      = db.getInstance()
    		stmt                    = tx.Statement
    		modelSchema, joinSchema *schema.Schema
    	)
    
    	err := stmt.Parse(model)
    	if err != nil {
    		return err
    	}
    	modelSchema = stmt.Schema
    
    	err = stmt.Parse(joinTable)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Aug 20 11:46:56 GMT 2023
    - 11.6K bytes
    - Viewed (0)
  10. clause/clause_test.go

    	"testing"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils/tests"
    )
    
    var db, _ = gorm.Open(tests.DummyDialector{}, nil)
    
    func checkBuildClauses(t *testing.T, clauses []clause.Interface, result string, vars []interface{}) {
    	var (
    		buildNames    []string
    		buildNamesMap = map[string]bool{}
    		user, _       = schema.Parse(&tests.User{}, &sync.Map{}, db.NamingStrategy)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Jun 02 02:50:38 GMT 2020
    - 1012 bytes
    - Viewed (0)
Back to top