- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 41 for primary_key (0.07 sec)
-
docs/ko/docs/tutorial/sql-databases.md
몇 가지 차이점이 있습니다: * `table=True`는 SQLModel에 이 모델이 *테이블 모델*이며, 단순한 데이터 모델이 아니라 SQL 데이터베이스의 **테이블**을 나타낸다는 것을 알려줍니다. (다른 일반적인 Pydantic 클래스처럼) 단순한 *데이터 모델*이 아닙니다. * `Field(primary_key=True)`는 SQLModel에 `id`가 SQL 데이터베이스의 **기본 키**임을 알려줍니다 (SQL 기본 키에 대한 자세한 내용은 SQLModel 문서를 참고하세요). `int | None` 유형으로 설정하면, SQLModel은 해당 열이 SQL 데이터베이스에서 `INTEGER` 유형이며 `NULLABLE` 값이어야 한다는 것을 알 수 있습니다.
Registered: Sun Sep 07 07:19:17 UTC 2025 - Last Modified: Tue Dec 24 16:14:29 UTC 2024 - 18K bytes - Viewed (0) -
tests/update_test.go
Name string Token Token `gorm:"foreignKey:UserID"` } func (t *TokenOwner) BeforeSave(tx *gorm.DB) error { t.Name += "_name" return nil } type Token struct { UserID int `gorm:"primary_key"` Content string `gorm:"type:varchar(100)"` } func (t *Token) BeforeSave(tx *gorm.DB) error { t.Content += "_encrypted" return nil } func TestSaveWithHooks(t *testing.T) {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Jul 21 02:46:58 UTC 2025 - 30.4K bytes - Viewed (0) -
tests/query_test.go
} AssertEqual(t, p, p2) } func TestStringPrimaryKeyForNumericValueStartingWithZero(t *testing.T) { type AddressByZipCode struct { ZipCode string `gorm:"primary_key"` Address string } DB.Migrator().DropTable(&AddressByZipCode{}) if err := DB.AutoMigrate(&AddressByZipCode{}); err != nil { t.Fatalf("failed to migrate, got error %v", err) }
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Jul 22 06:21:04 UTC 2025 - 51K bytes - Viewed (0) -
schema/relationship.go
} else { primarySchemaName := primarySchema.Name if primarySchemaName == "" { primarySchemaName = relation.FieldSchema.Name } if len(relation.primaryKeys) > 0 { for _, primaryKey := range relation.primaryKeys { if f := primarySchema.LookUpField(primaryKey); f != nil { primaryFields = append(primaryFields, f) } } } else { primaryFields = primarySchema.PrimaryFields }
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Aug 18 11:44:52 UTC 2025 - 23.1K bytes - Viewed (1) -
migrator/migrator.go
createTableSQL += "PRIMARY KEY ?," primaryKeys := make([]interface{}, 0, len(stmt.Schema.PrimaryFields)) for _, field := range stmt.Schema.PrimaryFields { primaryKeys = append(primaryKeys, clause.Column{Name: field.DBName}) } values = append(values, primaryKeys) } for _, idx := range stmt.Schema.ParseIndexes() {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Fri Jun 06 02:35:01 UTC 2025 - 29.5K bytes - Viewed (0) -
schema/schema_helper_test.go
for _, rf := range r.References { var primaryKey, primaryKeySchema string if rf.PrimaryKey != nil { primaryKey, primaryKeySchema = rf.PrimaryKey.Name, rf.PrimaryKey.Schema.Name } refs = append(refs, fmt.Sprintf( "{PrimaryKey: %v PrimaryKeySchame: %v ForeignKey: %v ForeignKeySchema: %v PrimaryValue: %v OwnPrimaryKey: %v}",
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Aug 28 02:57:17 UTC 2025 - 7.5K bytes - Viewed (0) -
utils/tests/models.go
Name string CustomID string Type string } type Company struct { ID int Name string } type Language struct { Code string `gorm:"primarykey"` Name string } type Coupon struct { ID int `gorm:"primarykey; size:255"` AppliesToProduct []*CouponProduct `gorm:"foreignKey:CouponId;constraint:OnDelete:CASCADE"` AmountOff uint32 `gorm:"column:amount_off"`
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Fri Dec 15 08:36:08 UTC 2023 - 2.1K bytes - Viewed (0) -
schema/schema_test.go
// check fields fields := []schema.Field{ {Name: "ID", DBName: "id", BindNames: []string{"Model", "ID"}, DataType: schema.Uint, PrimaryKey: true, Tag: `gorm:"primarykey"`, TagSettings: map[string]string{"PRIMARYKEY": "PRIMARYKEY"}, Size: 64, HasDefaultValue: true, AutoIncrement: true}, {Name: "CreatedAt", DBName: "created_at", BindNames: []string{"Model", "CreatedAt"}, DataType: schema.Time},
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Aug 28 02:57:17 UTC 2025 - 13.3K bytes - Viewed (0) -
clause/clause.go
c.AfterExpression.Build(builder) } } } const ( PrimaryKey string = "~~~py~~~" // primary key CurrentTable string = "~~~ct~~~" // current table Associations string = "~~~as~~~" // associations ) var ( currentTable = Table{Name: CurrentTable} PrimaryColumn = Column{Table: CurrentTable, Name: PrimaryKey} ) // Column quote with name type Column struct { Table string Name string
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Feb 02 09:15:08 UTC 2023 - 1.7K bytes - Viewed (0) -
clause/set.go
} builder.WriteQuoted(assignment.Column) builder.WriteByte('=') builder.AddVar(builder, assignment.Value) } } else { builder.WriteQuoted(Column{Name: PrimaryKey}) builder.WriteByte('=') builder.WriteQuoted(Column{Name: PrimaryKey}) } } // MergeClause merge assignments clauses func (set Set) MergeClause(clause *Clause) { copiedAssignments := make([]Assignment, len(set)) copy(copiedAssignments, set)
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Nov 29 03:02:44 UTC 2021 - 1.4K bytes - Viewed (0)