- Sort Score
- Result 10 results
- Languages All
Results 41 - 50 of 54 for primary_key (1.11 sec)
-
migrator/column_type.go
func (ct ColumnType) ColumnType() (columnType string, ok bool) { return ct.ColumnTypeValue.String, ct.ColumnTypeValue.Valid } // PrimaryKey returns the column is primary key or not. func (ct ColumnType) PrimaryKey() (isPrimaryKey bool, ok bool) { return ct.PrimaryKeyValue.Bool, ct.PrimaryKeyValue.Valid } // AutoIncrement returns the column is auto increment or not.
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Thu Mar 24 01:31:58 UTC 2022 - 3.3K bytes - Viewed (0) -
callbacks/create_test.go
"gorm.io/gorm" "gorm.io/gorm/clause" "gorm.io/gorm/schema" ) var schemaCache = &sync.Map{} func TestConvertToCreateValues_DestType_Slice(t *testing.T) { type user struct { ID int `gorm:"primaryKey"` Name string Email string `gorm:"default:(-)"` Age int `gorm:"default:(-)"` } s, err := schema.Parse(&user{}, schemaCache, schema.NamingStrategy{}) if err != nil {Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Mon Mar 18 05:48:42 UTC 2024 - 1.4K bytes - Viewed (0) -
schema/schema.go
schema.FieldsByBindName[bindName] = field if v != nil && v.PrimaryKey { // remove the existing primary key field for idx, f := range schema.PrimaryFields { if f.DBName == v.DBName { schema.PrimaryFields = append(schema.PrimaryFields[0:idx], schema.PrimaryFields[idx+1:]...) } } } if field.PrimaryKey { schema.PrimaryFields = append(schema.PrimaryFields, field) }
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Fri Oct 31 12:13:56 UTC 2025 - 13.1K bytes - Viewed (0) -
finisher_api.go
func (db *DB) First(dest interface{}, conds ...interface{}) (tx *DB) { tx = db.Limit(1).Order(clause.OrderByColumn{ Column: clause.Column{Table: clause.CurrentTable, Name: clause.PrimaryKey}, }) if len(conds) > 0 { if exprs := tx.Statement.BuildCondition(conds[0], conds[1:]...); len(exprs) > 0 { tx.Statement.AddClause(clause.Where{Exprs: exprs}) } }
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Fri Sep 19 01:49:06 UTC 2025 - 22.9K bytes - Viewed (0) -
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 Dec 28 09:35:17 UTC 2025 - Last Modified: Sun May 25 07:40:40 UTC 2025 - 10.4K bytes - Viewed (3) -
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 Dec 28 09:35:17 UTC 2025 - Last Modified: Sat Feb 19 09:02:53 UTC 2022 - 12.7K 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 Dec 28 09:35:17 UTC 2025 - Last Modified: Sun May 25 07:40:40 UTC 2025 - 5.8K 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 Dec 28 09:35:17 UTC 2025 - Last Modified: Mon Jul 21 09:55:20 UTC 2025 - 26.8K 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 Dec 28 09:35:17 UTC 2025 - Last Modified: Fri Sep 12 04:33:27 UTC 2025 - 20.9K 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 Dec 28 09:35:17 UTC 2025 - Last Modified: Tue Nov 04 07:04:52 UTC 2025 - 8.9K bytes - Viewed (0)