Search Options

Results per page
Sort
Preferred Languages
Advance

Results 151 - 160 of 301 for Strict (0.04 sec)

  1. tests/submodel_test.go

    		t.Fatalf("unexpected error: %v", err)
    	}
    
    	if err := DB.Model(&man).Where("id = ?", man.ID).Updates(struct {
    		Age int
    	}{Age: 20}).Error; err != nil {
    		t.Fatalf("unexpected error: %v", err)
    	}
    
    	var result = struct{
    		ID int
    		Age int
    	}{}
    	if err := DB.Model(&man).Where("id = ?", man.ID).Find(&result).Error; err != nil {
    		t.Fatalf("unexpected error: %v", err)
    	}
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Wed Aug 20 04:51:17 UTC 2025
    - 944 bytes
    - Viewed (0)
  2. schema/relationship.go

    		}
    	}
    }
    
    // User has many Toys, its `Polymorphic` is `Owner`, Pet has one Toy, its `Polymorphic` is `Owner`
    //
    //	type User struct {
    //	  Toys []Toy `gorm:"polymorphic:Owner;"`
    //	}
    //	type Pet struct {
    //	  Toy Toy `gorm:"polymorphic:Owner;"`
    //	}
    //	type Toy struct {
    //	  OwnerID   int
    //	  OwnerType string
    //	}
    func (schema *Schema) buildPolymorphicRelation(relation *Relationship, field *Field) {
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Mon Aug 18 11:44:52 UTC 2025
    - 23.1K bytes
    - Viewed (1)
  3. tests/error_translator_test.go

    	}
    }
    
    func TestSupportedDialectorWithErrForeignKeyViolated(t *testing.T) {
    	tidbSkip(t, "not support the foreign key feature")
    
    	type City struct {
    		gorm.Model
    		Name string `gorm:"unique"`
    	}
    
    	type Museum struct {
    		gorm.Model
    		Name   string `gorm:"unique"`
    		CityID uint
    		City   City `gorm:"Constraint:OnUpdate:CASCADE,OnDelete:CASCADE;FOREIGNKEY:CityID;References:ID"`
    	}
    
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Mon Jul 21 02:46:58 UTC 2025
    - 3.1K bytes
    - Viewed (0)
  4. schema/schema.go

    		return field
    	}
    	if field, ok := schema.FieldsByName[name]; ok {
    		return field
    	}
    	return nil
    }
    
    // LookUpFieldByBindName looks for the closest field in the embedded struct.
    //
    //	type Struct struct {
    //		Embedded struct {
    //			ID string // is selected by LookUpFieldByBindName([]string{"Embedded", "ID"}, "ID")
    //		}
    //		ID string // is selected by LookUpFieldByBindName([]string{"ID"}, "ID")
    //	}
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Tue Aug 19 06:35:49 UTC 2025
    - 12.9K bytes
    - Viewed (0)
  5. clause/where.go

    package clause
    
    import (
    	"strings"
    )
    
    const (
    	AndWithSpace = " AND "
    	OrWithSpace  = " OR "
    )
    
    // Where where clause
    type Where struct {
    	Exprs []Expression
    }
    
    // Name where clause name
    func (where Where) Name() string {
    	return "WHERE"
    }
    
    // Build build where clause
    func (where Where) Build(builder Builder) {
    	if len(where.Exprs) == 1 {
    		if andCondition, ok := where.Exprs[0].(AndConditions); ok {
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Thu Apr 25 12:22:53 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  6. schema/serializer.go

    func init() {
    	RegisterSerializer("json", JSONSerializer{})
    	RegisterSerializer("unixtime", UnixSecondSerializer{})
    	RegisterSerializer("gob", GobSerializer{})
    }
    
    // Serializer field value serializer
    type serializer struct {
    	Field           *Field
    	Serializer      SerializerInterface
    	SerializeValuer SerializerValuerInterface
    	Destination     reflect.Value
    	Context         context.Context
    	value           interface{}
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Thu Jun 20 08:45:38 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  7. tests/postgres_test.go

    			}
    		}
    	}
    
    	if !hasLogID {
    		t.Fatalf("failed to found column log_id")
    	}
    }
    
    type Post struct {
    	ID         uuid.UUID `gorm:"primary_key;type:uuid;default:uuid_generate_v4();"`
    	Title      string
    	Categories []*Category `gorm:"Many2Many:post_categories"`
    }
    
    type Category struct {
    	ID    uuid.UUID `gorm:"primary_key;type:uuid;default:uuid_generate_v4();"`
    	Title string
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Sat Oct 08 09:16:32 UTC 2022
    - 6.4K bytes
    - Viewed (0)
  8. tests/joins_table_test.go

    import (
    	"testing"
    	"time"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    )
    
    type Person struct {
    	ID        int
    	Name      string
    	Addresses []Address `gorm:"many2many:person_addresses;"`
    	DeletedAt gorm.DeletedAt
    }
    
    type Address struct {
    	ID   uint
    	Name string
    }
    
    type PersonAddress struct {
    	PersonID  int
    	AddressID int
    	CreatedAt time.Time
    	DeletedAt gorm.DeletedAt
    }
    
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Thu Sep 10 13:46:18 UTC 2020
    - 3.5K bytes
    - Viewed (1)
  9. association.go

    					if association.Relationship.Field.FieldType.Kind() == reflect.Struct {
    						assignBacks = append(assignBacks, assignBack{Source: source, Dest: rv.Index(0)})
    					}
    				}
    			case reflect.Struct:
    				if !rv.CanAddr() {
    					association.Error = ErrInvalidValue
    					return
    				}
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 21.5K bytes
    - Viewed (0)
  10. clause/expression.go

    	Build(builder Builder)
    }
    
    // NegationExpressionBuilder negation expression builder
    type NegationExpressionBuilder interface {
    	NegationBuild(builder Builder)
    }
    
    // Expr raw expression
    type Expr struct {
    	SQL                string
    	Vars               []interface{}
    	WithoutParentheses bool
    }
    
    // Build build raw expression
    func (expr Expr) Build(builder Builder) {
    	var (
    		afterParenthesis bool
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Tue Oct 10 06:45:48 UTC 2023
    - 8.3K bytes
    - Viewed (0)
Back to top