Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for Farmer (0.59 sec)

  1. schema/index_test.go

    	Name6        int64  `gorm:"index:profile,comment:hello \\, world,where:age > 10"`
    	Age          int64  `gorm:"index:profile,expression:ABS(age),option:WITH PARSER parser_name"`
    	OID          int64  `gorm:"index:idx_id;index:idx_oid,unique"`
    	MemberNumber string `gorm:"index:idx_id,priority:1"`
    	Name7        string `gorm:"index:type"`
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 8K bytes
    - Viewed (0)
  2. schema/index.go

    )
    
    type Index struct {
    	Name    string
    	Class   string // UNIQUE | FULLTEXT | SPATIAL
    	Type    string // btree, hash, gist, spgist, gin, and brin
    	Where   string
    	Comment string
    	Option  string        // WITH PARSER parser_name
    	Fields  []IndexOption // Note: IndexOption's Field maybe the same
    }
    
    type IndexOption struct {
    	*Field
    	Expression string
    	Sort       string // DESC, ASC
    	Collate    string
    	Length     int
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  3. tests/table_test.go

    	}
    
    	AssertEqual(t, r.Statement.Vars, []interface{}{2, 4, 1, 3})
    }
    
    type UserWithTableNamer struct {
    	gorm.Model
    	Name string
    }
    
    func (UserWithTableNamer) TableName(namer schema.Namer) string {
    	return namer.TableName("user")
    }
    
    func TestTableWithNamer(t *testing.T) {
    	db, _ := gorm.Open(tests.DummyDialector{}, &gorm.Config{
    		NamingStrategy: schema.NamingStrategy{
    			TablePrefix: "t_",
    		},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Mar 09 09:31:28 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  4. tests/migrate_test.go

    	numField := typ.NumField()
    	if numField != len(columnTypes) {
    		t.Fatalf("column's number not match struct and ddl, %d != %d", numField, len(columnTypes))
    	}
    	namer := schema.NamingStrategy{}
    	for i := 0; i < numField; i++ {
    		expectName := namer.ColumnName("", typ.Field(i).Name)
    		if columnTypes[i].Name() != expectName {
    			t.Fatalf("column order not match struct and ddl, idx %d: %s != %s",
    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)
  5. schema/schema.go

    }
    
    type Tabler interface {
    	TableName() string
    }
    
    type TablerWithNamer interface {
    	TableName(Namer) string
    }
    
    // Parse get data type from dialector
    func Parse(dest interface{}, cacheStore *sync.Map, namer Namer) (*Schema, error) {
    	return ParseWithSpecialTableName(dest, cacheStore, namer, "")
    }
    
    // ParseWithSpecialTableName get data type from dialector with extra schema table
    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)
  6. schema/relationship.go

    		Tag:  `gorm:"-"`,
    	})
    
    	if relation.JoinTable, err = Parse(reflect.New(reflect.StructOf(joinTableFields)).Interface(), schema.cacheStore,
    		schema.namer); err != nil {
    		schema.err = err
    	}
    	relation.JoinTable.Name = many2many
    	relation.JoinTable.Table = schema.namer.JoinTableName(many2many)
    	relation.JoinTable.PrimaryFields = make([]*Field, 0, len(relation.JoinTable.Fields))
    
    	relName := relation.Schema.Name
    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)
  7. schema/field.go

    			field.Readable = false
    
    			cacheStore := &sync.Map{}
    			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
    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. gorm.go

    	// You can disable it by setting `SkipDefaultTransaction` to true
    	SkipDefaultTransaction bool
    	// NamingStrategy tables, columns naming strategy
    	NamingStrategy schema.Namer
    	// FullSaveAssociations full save associations
    	FullSaveAssociations bool
    	// Logger
    	Logger logger.Interface
    	// NowFunc the function to be used when creating a new timestamp
    	NowFunc func() time.Time
    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)
  9. schema/constraint.go

    				checks[names[0]] = CheckConstraint{Name: names[0], Constraint: strings.Join(names[1:], ","), Field: field}
    			} else {
    				if names[0] == "" {
    					chk = strings.Join(names[1:], ",")
    				}
    				name := schema.namer.CheckerName(schema.Table, field.DBName)
    				checks[name] = CheckConstraint{Name: name, Constraint: chk, Field: field}
    			}
    		}
    	}
    	return checks
    }
    
    type UniqueConstraint struct {
    	Name  string
    	Field *Field
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 07:33:54 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  10. scan.go

    		if field == nil {
    			continue
    		}
    
    		if len(joinFields) == 0 || len(joinFields[idx]) == 0 {
    			db.AddError(field.Set(db.Statement.Context, reflectValue, values[idx]))
    		} else { // joinFields count is larger than 2 when using join
    			var isNilPtrValue bool
    			var relValue reflect.Value
    			// does not contain raw dbname
    			nestedJoinSchemas := joinFields[idx][:len(joinFields[idx])-1]
    			// current reflect value
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 09:53:11 GMT 2024
    - 9.8K bytes
    - Viewed (0)
Back to top