Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for Reference (0.52 sec)

  1. schema/relationship_test.go

    			References: []Reference{
    				{"ID", "Blog", "BlogID", "shared_blog_tags", "", true},
    				{"ID", "Tag", "TagID", "shared_blog_tags", "", false},
    			},
    		},
    		Relation{
    			Name: "LocaleTags", Type: schema.Many2Many, Schema: "Blog", FieldSchema: "Tag",
    			JoinTable: JoinTable{Name: "locale_blog_tags", Table: "locale_blog_tags"},
    			References: []Reference{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  2. finisher_api.go

    // Update updates column with value using callbacks. Reference: https://gorm.io/docs/update.html#Update-Changed-Fields
    func (db *DB) Update(column string, value interface{}) (tx *DB) {
    	tx = db.getInstance()
    	tx.Statement.Dest = map[string]interface{}{column: value}
    	return tx.callbacks.Update().Execute(tx)
    }
    
    // Updates updates attributes using callbacks. values must be a struct or map. Reference: https://gorm.io/docs/update.html#Update-Changed-Fields
    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)
  3. schema/schema_test.go

    	// check relations
    	relations := []Relation{
    		{
    			Name: "Account", Type: schema.HasOne, Schema: "User", FieldSchema: "Account",
    			References: []Reference{{"ID", "User", "UserID", "Account", "", true}},
    		},
    		{
    			Name: "Pets", Type: schema.HasMany, Schema: "User", FieldSchema: "Pet",
    			References: []Reference{{"ID", "User", "UserID", "Pet", "", true}},
    		},
    		{
    			Name: "Toys", Type: schema.HasMany, Schema: "User", FieldSchema: "Toy",
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  4. schema/schema_helper_test.go

    				}
    			}
    
    			if len(relation.References) != len(r.References) {
    				t.Errorf("schema %v relation's reference's count doesn't match, expects %v, but got %v", s, len(relation.References), len(r.References))
    			}
    
    			for _, ref := range relation.References {
    				var found bool
    				for _, rf := range r.References {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  5. README.md

    [![MIT license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)
    [![Go.Dev reference](https://img.shields.io/badge/go.dev-reference-blue?logo=go&logoColor=white)](https://pkg.go.dev/gorm.io/gorm?tab=doc)
    
    ## Overview
    
    * Full-Featured ORM
    Plain Text
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Nov 07 02:20:06 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  6. utils/tests/models.go

    // He speaks many languages (many to many) and has many friends (many to many - single-table)
    // His pet also has one Toy (has one - polymorphic)
    // NamedPet is a reference to a named `Pet` (has one)
    type User struct {
    	gorm.Model
    	Name      string
    	Age       uint
    	Birthday  *time.Time
    	Account   Account
    	Pets      []*Pet
    	NamedPet  *Pet
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  7. schema/relationship.go

    				joinRel := relation.JoinTable.Relationships.Relations[relName]
    				joinRel.Field = relation.Field
    				joinRel.References = append(joinRel.References, &Reference{
    					PrimaryKey: of,
    					ForeignKey: f,
    				})
    
    				relation.References = append(relation.References, &Reference{
    					PrimaryKey:    of,
    					ForeignKey:    f,
    					OwnPrimaryKey: true,
    				})
    			}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
  8. callbacks/query.go

    										Name:  s,
    										Alias: utils.NestedRelationName(tableAliasName, s),
    									})
    								}
    							}
    
    							exprs := make([]clause.Expression, len(relation.References))
    							for idx, ref := range relation.References {
    								if ref.OwnPrimaryKey {
    									exprs[idx] = clause.Eq{
    										Column: clause.Column{Table: parentTableName, Name: ref.PrimaryKey.DBName},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Jan 29 03:34:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  9. callbacks/preload.go

    	)
    
    	if rel.JoinTable != nil {
    		var (
    			joinForeignFields    = make([]*schema.Field, 0, len(rel.References))
    			joinRelForeignFields = make([]*schema.Field, 0, len(rel.References))
    			joinForeignKeys      = make([]string, 0, len(rel.References))
    		)
    
    		for _, ref := range rel.References {
    			if ref.OwnPrimaryKey {
    				joinForeignKeys = append(joinForeignKeys, ref.ForeignKey.DBName)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  10. tests/error_translator_test.go

    		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"`
    	}
    
    	db, err := OpenTestConnection(&gorm.Config{TranslateError: true})
    	if err != nil {
    		t.Fatalf("failed to connect database, got error %v", err)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Jul 12 13:21:22 GMT 2023
    - 3.1K bytes
    - Viewed (0)
Back to top