Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for _id (0.15 sec)

  1. tests/connpool_test.go

    			"INSERT INTO `users` (`created_at`,`updated_at`,`deleted_at`,`name`,`age`,`birthday`,`company_id`,`manager_id`,`active`) VALUES (?,?,?,?,?,?,?,?,?)",
    			"SELECT * FROM `users` WHERE name = ? AND `users`.`deleted_at` IS NULL ORDER BY `users`.`id` LIMIT ?",
    			"INSERT INTO `users` (`created_at`,`updated_at`,`deleted_at`,`name`,`age`,`birthday`,`company_id`,`manager_id`,`active`) VALUES (?,?,?,?,?,?,?,?,?)",
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Feb 06 02:54:40 GMT 2024
    - 5.5K bytes
    - Viewed (0)
  2. tests/embedded_struct_test.go

    	if err := DB.Migrator().AutoMigrate(&HNPost{}, &EngadgetPost{}); err != nil {
    		t.Fatalf("failed to auto migrate, got error: %v", err)
    	}
    
    	for _, name := range []string{"author_id", "author_name", "author_email"} {
    		if !DB.Migrator().HasColumn(&EngadgetPost{}, name) {
    			t.Errorf("should has prefixed column %v", name)
    		}
    	}
    
    	stmt := gorm.Statement{DB: DB}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Oct 26 03:58:13 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  3. tests/update_has_one_test.go

    		if err := DB.Session(&gorm.Session{FullSaveAssociations: true}).Updates(&cusUser).Error; err != nil {
    			t.Fatalf("errors happened when create: %v", err)
    		}
    
    		var account2 CustomizeAccount
    		DB.Find(&account2, "user_id = ?", cusUser.ID)
    		AssertEqual(t, account2.Number, number)
    		AssertEqual(t, account2.Number2, cusUser.Account.Number2)
    	})
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jul 14 06:55:54 GMT 2022
    - 3.6K bytes
    - Viewed (0)
  4. tests/postgres_test.go

    		SomeID  string
    		OtherID string
    		Data    string
    	}
    
    	DB.Migrator().DropTable(&Thing{})
    	DB.Migrator().CreateTable(&Thing{})
    	if err := DB.Exec("ALTER TABLE things ADD CONSTRAINT some_id_other_id_unique UNIQUE (some_id, other_id)").Error; err != nil {
    		t.Error(err)
    	}
    
    	thing := Thing{
    		SomeID:  "1234",
    		OtherID: "1234",
    		Data:    "something",
    	}
    
    	DB.Create(&thing)
    
    	thing2 := Thing{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Oct 08 09:16:32 GMT 2022
    - 6.4K bytes
    - Viewed (3)
  5. clause/joins_test.go

    				},
    			},
    			sql: "LEFT JOIN `user` ON `user_info`.`user_id` = `users`.`id`",
    		},
    		{
    			name: "RIGHT JOIN",
    			join: clause.Join{
    				Type:  clause.RightJoin,
    				Table: clause.Table{Name: "user"},
    				ON: clause.Where{
    					Exprs: []clause.Expression{clause.Eq{clause.Column{Table: "user_info", Name: "user_id"}, clause.PrimaryColumn}},
    				},
    			},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Nov 03 13:03:13 GMT 2022
    - 2.6K bytes
    - Viewed (0)
  6. schema/naming_test.go

    		"PFAndESI":                  "pf_and_esi",
    		"AbcAndJkl":                 "abc_and_jkl",
    		"EmployeeID":                "employee_id",
    		"SKU_ID":                    "sku_id",
    		"FieldX":                    "field_x",
    		"HTTPAndSMTP":               "http_and_smtp",
    		"HTTPServerHandlerForURLID": "http_server_handler_for_url_id",
    		"UUID":                      "uuid",
    		"HTTPURL":                   "http_url",
    		"HTTP_URL":                  "http_url",
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue May 30 02:00:48 GMT 2023
    - 7K bytes
    - Viewed (0)
  7. tests/distinct_test.go

    	}
    
    	dryDB := DB.Session(&gorm.Session{DryRun: true})
    	r := dryDB.Distinct("u.id, u.*").Table("user_speaks as s").Joins("inner join users as u on u.id = s.user_id").Where("s.language_code ='US' or s.language_code ='ES'").Find(&User{})
    	if !regexp.MustCompile(`SELECT DISTINCT u\.id, u\.\* FROM user_speaks as s inner join users as u`).MatchString(r.Statement.SQL.String()) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 2.5K bytes
    - Viewed (0)
  8. tests/customize_field_test.go

    package tests_test
    
    import (
    	"testing"
    	"time"
    
    	"gorm.io/gorm"
    	. "gorm.io/gorm/utils/tests"
    )
    
    func TestCustomizeColumn(t *testing.T) {
    	type CustomizeColumn struct {
    		ID   int64      `gorm:"column:mapped_id; primary_key:yes"`
    		Name string     `gorm:"column:mapped_name"`
    		Date *time.Time `gorm:"column:mapped_time"`
    	}
    
    	DB.Migrator().DropTable(&CustomizeColumn{})
    	DB.AutoMigrate(&CustomizeColumn{})
    
    	expected := "foo"
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Sep 11 09:33:31 GMT 2020
    - 6.9K bytes
    - Viewed (0)
  9. schema/index_test.go

    	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"`
    	Name8        string `gorm:"index:,length:10;index:,collate:utf8"`
    
    	// Composite Index: Flattened structure.
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 8K bytes
    - Viewed (0)
  10. tests/scan_test.go

    	var personAddressInfoList []*PersonAddressInfo
    	if err := DB.Select("people.*, addresses.*").
    		Table("people").
    		Joins("inner join person_addresses on people.id = person_addresses.person_id").
    		Joins("inner join addresses on person_addresses.address_id = addresses.id").
    		Find(&personAddressInfoList).Error; err != nil {
    		t.Errorf("Failed to run join query, got error: %v", err)
    	}
    
    	personMatched := false
    	addressMatched := false
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat May 28 14:18:07 GMT 2022
    - 8.2K bytes
    - Viewed (0)
Back to top