- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 33 for PrimaryKey (0.12 sec)
-
callbacks/query.go
for idx, ref := range relation.References { if ref.OwnPrimaryKey { exprs[idx] = clause.Eq{ Column: clause.Column{Table: parentTableName, Name: ref.PrimaryKey.DBName}, Value: clause.Column{Table: tableAliasName, Name: ref.ForeignKey.DBName}, } } else { if ref.PrimaryValue == "" { exprs[idx] = clause.Eq{
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Sun May 25 07:40:40 UTC 2025 - 10.4K bytes - Viewed (1) -
schema/field_test.go
if err != nil { t.Fatalf("Failed to parse user with permission, got error %v", err) } fields := []*schema.Field{ {Name: "ID", DBName: "id", BindNames: []string{"ID"}, DataType: schema.Uint, PrimaryKey: true, Size: 64, Creatable: true, Updatable: true, Readable: true, HasDefaultValue: true, AutoIncrement: true},
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Sat Feb 19 09:02:53 UTC 2022 - 12.7K bytes - Viewed (0) -
tests/multi_primary_keys_test.go
t.Fatalf("EN Blog's tags should be cleared") } } func TestCompositePrimaryKeysAssociations(t *testing.T) { type Label struct { BookID *uint `gorm:"primarykey"` Name string `gorm:"primarykey"` Value string } type Book struct { ID int Name string Labels []Label } DB.Migrator().DropTable(&Label{}, &Book{})
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Jul 21 02:46:58 UTC 2025 - 13.1K bytes - Viewed (0) -
statement.go
conds = append(conds, clause.IN{Column: clause.Column{Table: curTable, Name: clause.PrimaryKey}, Values: values}) return []clause.Expression{clause.And(conds...)} } return nil } } conds = append(conds, clause.IN{Column: clause.Column{Table: curTable, Name: clause.PrimaryKey}, Values: args}) } } } if len(conds) > 0 {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Sep 04 13:13:16 UTC 2025 - 20.8K bytes - Viewed (0) -
tests/migrate_test.go
return } type Event struct { ID uint `gorm:"primarykey"` UID uint32 } type Event1 struct { ID uint `gorm:"primarykey"` UID uint32 `gorm:"not null;autoIncrement"` } type Event2 struct { ID uint `gorm:"primarykey"` UID uint16 `gorm:"not null;autoIncrement"` } var err error
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Wed Aug 20 04:51:17 UTC 2025 - 65.2K bytes - Viewed (0) -
tests/create_test.go
} } func TestCreateWithAutoIncrementCompositeKey(t *testing.T) { type CompositeKeyProduct struct { ProductID int `gorm:"primaryKey;autoIncrement:true;"` // primary key LanguageCode int `gorm:"primaryKey;"` // primary key Code string Name string } if err := DB.Migrator().DropTable(&CompositeKeyProduct{}); err != nil {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Jul 21 09:55:20 UTC 2025 - 26.8K bytes - Viewed (0) -
callbacks/delete.go
tx = db.Session(&gorm.Session{NewDB: true}).Model(modelValue).Table(table) ) for _, ref := range rel.References { if ref.OwnPrimaryKey { foreignFields = append(foreignFields, ref.PrimaryKey) relForeignKeys = append(relForeignKeys, ref.ForeignKey.DBName) } else if ref.PrimaryValue != "" { queryConds = append(queryConds, clause.Eq{
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Sun May 25 07:40:40 UTC 2025 - 5.8K bytes - Viewed (0) -
clause/expression_test.go
}, { SQL: "?", Vars: []interface{}{clause.Column{Table: "table", Name: "col", Raw: true}}, Result: "table.col", }, { SQL: "?", Vars: []interface{}{clause.Column{Table: "table", Name: clause.PrimaryKey, Raw: true}}, Result: "table.id", }, { SQL: "?", Vars: []interface{}{clause.Column{Table: "table", Name: "col", Alias: "alias"}}, Result: "`table`.`col` AS `alias`", }, { SQL: "?",
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Aug 10 05:34:33 UTC 2023 - 8.4K bytes - Viewed (0) -
callbacks/update.go
case reflect.Struct: set = make([]clause.Assignment, 0, len(stmt.Schema.FieldsByDBName)) for _, dbName := range stmt.Schema.DBNames { if field := updatingSchema.LookUpField(dbName); field != nil { if !field.PrimaryKey || !updatingValue.CanAddr() || stmt.Dest != stmt.Model { if v, ok := selectColumns[field.DBName]; (ok && v) || (!ok && (!restricted || (!stmt.SkipHooks && field.AutoUpdateTime > 0))) {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Sun May 25 07:40:40 UTC 2025 - 9.6K bytes - Viewed (0) -
callbacks/create.go
for _, column := range values.Columns { if field := stmt.Schema.LookUpField(column.Name); field != nil { if v, ok := selectColumns[field.DBName]; (ok && v) || (!ok && !restricted) { if !field.PrimaryKey && (!field.HasDefaultValue || field.DefaultValueInterface != nil || strings.EqualFold(field.DefaultValue, "NULL")) && field.AutoCreateTime == 0 { if field.AutoUpdateTime > 0 {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Jul 29 11:06:13 UTC 2025 - 13K bytes - Viewed (0)