Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 50 for Fields (0.16 sec)

  1. chainable_api.go

    	tx.Statement.Distinct = true
    	if len(args) > 0 {
    		tx = tx.Select(args[0], args[1:]...)
    	}
    	return
    }
    
    // Select specify fields that you want when querying, creating, updating
    //
    // Use Select when you only want a subset of the fields. By default, GORM will select all fields.
    // Select accepts both string arguments and arrays.
    //
    //	// Select name and age of user using multiple arguments
    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)
  2. schema/schema_helper_test.go

    				}
    			}
    
    			for _, name := range []string{f.DBName, f.Name} {
    				if name != "" {
    					if field := s.LookUpField(name); field == nil || (field.Name != name && field.DBName != name) {
    						t.Errorf("schema %v failed to look up field with dbname %v", s, f.DBName)
    					}
    				}
    			}
    
    			if f.PrimaryKey {
    				var found bool
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  3. callbacks/associations.go

    						obj := db.Statement.ReflectValue.Index(i)
    						if reflect.Indirect(obj).Kind() != reflect.Struct {
    							break
    						}
    						if _, zero := rel.Field.ValueOf(db.Statement.Context, obj); !zero { // check belongs to relation value
    							rv := rel.Field.ReflectValueOf(db.Statement.Context, obj) // relation reflect value
    							if !isPtr {
    								rv = rv.Addr()
    							}
    							objs = append(objs, obj)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Apr 11 03:06:13 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  4. schema/index_test.go

    				{Field: &schema.Field{Name: "FieldD"}},
    			},
    		},
    		"uniq_field_e1_e2": {
    			Name:  "uniq_field_e1_e2",
    			Class: "UNIQUE",
    			Fields: []schema.IndexOption{
    				{Field: &schema.Field{Name: "FieldE1"}},
    				{Field: &schema.Field{Name: "FieldE2"}},
    			},
    		},
    		"idx_index_tests_field_f1": {
    			Name:   "idx_index_tests_field_f1",
    			Fields: []schema.IndexOption{{Field: &schema.Field{Name: "FieldF1"}}},
    		},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 8K bytes
    - Viewed (0)
  5. migrator/migrator.go

    	expr.SQL = m.DataTypeOf(field)
    
    	if field.NotNull {
    		expr.SQL += " NOT NULL"
    	}
    
    	if field.HasDefaultValue && (field.DefaultValueInterface != nil || field.DefaultValue != "") {
    		if field.DefaultValueInterface != nil {
    			defaultStmt := &gorm.Statement{Vars: []interface{}{field.DefaultValueInterface}}
    			m.Dialector.BindVarTo(defaultStmt, defaultStmt, field.DefaultValueInterface)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  6. finisher_api.go

    		expr := clause.Expr{SQL: "count(*)"}
    
    		if len(tx.Statement.Selects) == 1 {
    			dbName := tx.Statement.Selects[0]
    			fields := strings.FieldsFunc(dbName, utils.IsValidDBNameChar)
    			if len(fields) == 1 || (len(fields) == 3 && (strings.ToUpper(fields[1]) == "AS" || fields[1] == ".")) {
    				if tx.Statement.Parse(tx.Statement.Model) == nil {
    					if f := tx.Statement.Schema.LookUpField(dbName); 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)
  7. errors.go

    	// 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")
    	// ErrInvalidData unsupported data
    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. schema/index.go

    					idx.Option = index.Option
    				}
    
    				idx.Fields = append(idx.Fields, index.Fields...)
    				sort.Slice(idx.Fields, func(i, j int) bool {
    					return idx.Fields[i].priority < idx.Fields[j].priority
    				})
    
    				indexes[index.Name] = idx
    			}
    		}
    	}
    	for _, index := range indexes {
    		if index.Class == "UNIQUE" && len(index.Fields) == 1 {
    			index.Fields[0].Field.UniqueIndex = index.Name
    		}
    	}
    	return indexes
    }
    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)
  9. model.go

    package gorm
    
    import "time"
    
    // Model a basic GoLang struct which includes the following fields: ID, CreatedAt, UpdatedAt, DeletedAt
    // It may be embedded into your model or you may build your own model without it
    //
    //	type User struct {
    //	  gorm.Model
    //	}
    type Model struct {
    	ID        uint `gorm:"primarykey"`
    	CreatedAt time.Time
    	UpdatedAt time.Time
    	DeletedAt DeletedAt `gorm:"index"`
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Feb 18 01:06:43 GMT 2023
    - 396 bytes
    - Viewed (0)
  10. schema/utils.go

    // GetIdentityFieldValuesMapFromValues get identity map from fields
    func GetIdentityFieldValuesMapFromValues(ctx context.Context, values []interface{}, fields []*Field) (map[string][]reflect.Value, [][]interface{}) {
    	resultsMap := map[string][]reflect.Value{}
    	results := [][]interface{}{}
    
    	for _, v := range values {
    		rm, rs := GetIdentityFieldValuesMap(ctx, reflect.Indirect(reflect.ValueOf(v)), fields)
    		for k, v := range rm {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Aug 19 13:35:14 GMT 2023
    - 5.5K bytes
    - Viewed (0)
Back to top